item mng with sync
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Brand : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int? ExternalErpId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Category : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int? ExternalErpId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,35 @@
|
||||
namespace Distribution.Models
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Item : Template
|
||||
{
|
||||
|
||||
public string Sku { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
public Guid FK_CategoryId { get; set; }
|
||||
[ForeignKey("FK_CategoryId")]
|
||||
public Category Category { get; set; }
|
||||
|
||||
public Guid? FK_SubCategoryId { get; set; }
|
||||
[ForeignKey("FK_SubCategoryId")]
|
||||
public SubCategory? SubCategory { get; set; }
|
||||
|
||||
public Guid? FK_BrandId { get; set; }
|
||||
[ForeignKey("FK_BrandId")]
|
||||
public Brand? Brand { get; set; }
|
||||
|
||||
public Guid FK_BaseUomId { get; set; }
|
||||
[ForeignKey("FK_BaseUomId")]
|
||||
public Uom BaseUom { get; set; }
|
||||
|
||||
public decimal? SalePrice { get; set; }
|
||||
|
||||
public SyncSource SyncSource { get; set; } = SyncSource.Manual;
|
||||
public int? ExternalErpItemId { get; set; }
|
||||
public DateTime? LastSyncedAt { get; set; }
|
||||
|
||||
public ICollection<UomConversion> Conversions { get; set; } = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace Distribution.Models
|
||||
[ForeignKey("FK_ItemId")]
|
||||
public Item Item { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class SubCategory : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Guid FK_CategoryId { get; set; }
|
||||
[ForeignKey("FK_CategoryId")]
|
||||
public Category Category { get; set; }
|
||||
public int? ExternalErpId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public enum SyncSource { Manual, Erp }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Uom : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int? ExternalErpId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class UomConversion
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
public Guid FK_ItemId { get; set; }
|
||||
[ForeignKey("FK_ItemId")]
|
||||
public Item Item { get; set; }
|
||||
|
||||
public Guid FK_FromUomId { get; set; }
|
||||
[ForeignKey("FK_FromUomId")]
|
||||
public Uom FromUom { get; set; }
|
||||
|
||||
public Guid FK_ToUomId { get; set; }
|
||||
[ForeignKey("FK_ToUomId")]
|
||||
public Uom ToUom { get; set; }
|
||||
|
||||
public decimal Factor { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user