using SqlSugar;
namespace EasyTemplate.Tool.Entity;
///
/// 规格
///
[SugarTable(null, "规格")]
[SugarIndex("ProductId", nameof(ProductId), OrderByType.Desc)]
public partial class TProductSku: EntityBase
{
///
/// 商品Id
///
[SugarColumn(ColumnDescription = "商品Id", IsNullable = true)]
public long ProductId { get; set; }
///
/// 属性id列表
///
[SugarColumn(ColumnDescription = "属性id列表", IsNullable = true)]
public string PropertyIds { get; set; }
///
/// 规格名称
///
[SugarColumn(ColumnDescription = "规格名称", IsNullable = true)]
public string PropertyName { get; set; }
///
/// 规格编码
///
[SugarColumn(ColumnDescription = "规格编码", IsNullable = true)]
public string Code { get; set; }
///
/// 预览图
///
[SugarColumn(ColumnDescription = "规格图", IsNullable = true)]
public string Image { get; set; }
///
/// 价格
///
[SugarColumn(ColumnDescription = "价格", DefaultValue = "0", DecimalDigits =2, IsNullable = true)]
public decimal Price { get; set; }
///
/// 成本价
///
[SugarColumn(ColumnDescription = "成本价", DefaultValue = "0", DecimalDigits = 2, IsNullable = true)]
public decimal Cost { get; set; }
///
/// 总库存
///
[SugarColumn(ColumnDescription = "库存", DefaultValue = "0", IsNullable = true)]
public int Stock { get; set; }
}
public class TProductSkuSeedData : ISeedData
{
public IEnumerable Generate()
=>
[
new TProductSku() { Id = 1, ProductId=1, PropertyName="红色/水果", PropertyIds="4,8", Code="S20250827135434201-1", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
new TProductSku() { Id = 1, ProductId=1, PropertyName="红色/可乐", PropertyIds="4,9", Code="S20250827135434202-2", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
new TProductSku() { Id = 1, ProductId=1, PropertyName="绿色/水果", PropertyIds="5,8", Code="S20250827135434203-3", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
new TProductSku() { Id = 1, ProductId=1, PropertyName="绿色/可乐", PropertyIds="5,9", Code="S20250827135434204-4", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
new TProductSku() { Id = 1, ProductId=1, PropertyName="黄色/水果", PropertyIds="6,8", Code="S20250827135434205-5", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
new TProductSku() { Id = 1, ProductId=1, PropertyName="黄色/可乐", PropertyIds="6,9", Code="S20250827135434206-6", Image="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", Cost=2.50M, Price=9.99M, Stock=999 },
];
}