using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 产品属性组合商品数据
    /// </summary>
    [Table("ProductAttributeCombinations")]
    public class ProductAttributeCombination
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 产品ID
        /// </summary>
        public long ProductId { get; set; }

        /// <summary>
        /// 归属公司ID
        /// </summary>
        public long CorporationId { get; set; }

        /// <summary>
        /// 供应制造商ID
        /// </summary>
        public long ManufacturerId { get; set; }

        /// <summary>
        /// 属性JSON
        /// </summary>
        [Column(TypeName = "text")]
        public string AttributesJson { get; set; } = string.Empty;

        /// <summary>
        /// 库存数量
        /// </summary>
        public int StockQuantity { get; set; }

        /// <summary>
        /// 销售数量
        /// </summary>
        public int SalesQuantity { get; set; }

        /// <summary>
        /// SKU编码
        /// </summary>
        [Column(TypeName = "varchar(20)")]
        public string SkuNumber { get; set; } = string.Empty;

        /// <summary>
        /// 重量
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal Weight { get; set; }

        /// <summary>
        /// 重量单位，1克，2千克，3磅，4盎司
        /// </summary>
        public int WeightUnit { get; set; }

        /// <summary>
        /// 销售加工费
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal ProcessCharge { get; set; }

        /// <summary>
        /// 加工费成本
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal ProcessCost { get; set; }

        /// <summary>
        /// 销售附加费
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal Surcharge { get; set; }

        /// <summary>
        /// 附加费成本
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]
        public decimal SurchargeCost { get; set; }

        /// <summary>
        /// SKU的市场价，划线价
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]

        public decimal MarketPrice { get; set; }

        /// <summary>
        /// SKU的销售价格
        /// </summary>
        [Column(TypeName = "decimal(18,4)")]

        public decimal Price { get; set; }

        /// <summary>
        /// 标记
        /// </summary>
        public int Mark { get; set; }

        /// <summary>
        /// 备注说明
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string Note { get; set; } = string.Empty;

        /// <summary>
        /// 是否禁用停售
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? UpdateTime { get; set; }
    }
}
