using System;
using SqlSugar;

namespace MDL.Models
{
    /// <summary>
    /// 出库交接单状态枚举
    /// </summary>
    public enum ShippingHandoverFormStatus
    {
        /// <summary>
        /// 草稿状态
        /// </summary>
        Draft = 0,
        /// <summary>
        /// 已出库状态
        /// </summary>
        Completed = 1
    }

    /// <summary>
    /// 出货交接单实体类
    /// </summary>
    [SugarTable("shipping_handover_forms")]
    public class ShippingHandoverFormEntity
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 交接单号
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string HandoverNumber { get; set; }

        /// <summary>
        /// 大包数（袋牌数量）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int BigBagCount { get; set; }

        /// <summary>
        /// 小包数（包裹数量）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int SmallBagCount { get; set; }

        /// <summary>
        /// 渠道
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string Channel { get; set; }

        /// <summary>
        /// 交货时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? DeliveryTime { get; set; }

        /// <summary>
        /// POD (Proof of Delivery) 图片链接，多张用逗号隔开
        /// </summary>
        [SugarColumn(ColumnDataType = "TEXT", IsNullable = true)]
        public string POD { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDataType = "TEXT", IsNullable = true)]
        public string Remarks { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = false)]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;

        /// <summary>
        /// 时区
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string TimeZone { get; set; }

        /// <summary>
        /// 交接单状态
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public ShippingHandoverFormStatus Status { get; set; } = ShippingHandoverFormStatus.Draft;
    }
}