feat: remove Supplier/SupplierOffering/PurchaseItem entities and migrate schema
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
namespace CutList.Web.Data.Entities;
|
||||
|
||||
public enum PurchaseItemStatus
|
||||
{
|
||||
Pending,
|
||||
Ordered,
|
||||
Received
|
||||
}
|
||||
|
||||
public class PurchaseItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int StockItemId { get; set; }
|
||||
public int? SupplierId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public int? JobId { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public PurchaseItemStatus Status { get; set; } = PurchaseItemStatus.Pending;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
public StockItem StockItem { get; set; } = null!;
|
||||
public Supplier? Supplier { get; set; }
|
||||
public Job? Job { get; set; }
|
||||
}
|
||||
@@ -13,6 +13,5 @@ public class StockItem
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
public Material Material { get; set; } = null!;
|
||||
public ICollection<SupplierOffering> SupplierOfferings { get; set; } = new List<SupplierOffering>();
|
||||
public ICollection<StockTransaction> Transactions { get; set; } = new List<StockTransaction>();
|
||||
}
|
||||
|
||||
@@ -7,14 +7,11 @@ public class StockTransaction
|
||||
public int Quantity { get; set; }
|
||||
public StockTransactionType Type { get; set; }
|
||||
public int? JobId { get; set; }
|
||||
public int? SupplierId { get; set; }
|
||||
public decimal? UnitPrice { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public StockItem StockItem { get; set; } = null!;
|
||||
public Job? Job { get; set; }
|
||||
public Supplier? Supplier { get; set; }
|
||||
}
|
||||
|
||||
public enum StockTransactionType
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace CutList.Web.Data.Entities;
|
||||
|
||||
public class Supplier
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? ContactInfo { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<SupplierOffering> Offerings { get; set; } = new List<SupplierOffering>();
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
namespace CutList.Web.Data.Entities;
|
||||
|
||||
public class SupplierOffering
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int StockItemId { get; set; }
|
||||
public int SupplierId { get; set; }
|
||||
public string? PartNumber { get; set; }
|
||||
public string? SupplierDescription { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public StockItem StockItem { get; set; } = null!;
|
||||
public Supplier Supplier { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user