using System;
using SqlSugar;

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

    /// <summary>
    /// 到货交接单实体类
    /// </summary>
    [SugarTable("arrival_handover_forms")]
    public class ArrivalHandoverFormEntity
    {
        /// <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 = true)]
        public DateTime? LogisticsProviderArrivalTime { get; set; }

        /// <summary>
        /// 收货时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ReceiptTime { 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 ArrivalHandoverFormStatus Status { get; set; } = ArrivalHandoverFormStatus.Draft;
    }
}