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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 原料采购批次
    /// </summary>
    [Table("MaterialBatchs")]
    public class MaterialBatch
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 类型：采购、借调、借调归还
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 原料数据ID
        /// </summary>
        public long MaterialId { get; set; }

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

        /// <summary>
        /// 原料归属店铺网点ID
        /// </summary>
        public long StoreId { get; set; }

        /// <summary>
        /// 原料当前数量
        /// </summary>
        public decimal Quantity { get; set; }

        /// <summary>
        /// 原料批次总量
        /// </summary>
        public decimal TotalQuantity { get; set; }

        /// <summary>
        /// 原料采购价格
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 数据创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime CreateTime { get; set; } = DateTime.UtcNow;

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