using System;
using SqlSugar;

namespace MDL.Models
{
    /// <summary>
    /// 货物数据实体类，用于存储从Excel导入的提单号和大包号信息
    /// </summary>
    [SugarTable("cargo_data")]
    public class CargoDataEntity
    {
        /// <summary>
        /// 主键ID，自增
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        
        /// <summary>
        /// 提单号
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string? BillOfLadingNumber { get; set; }
        
        /// <summary>
        /// 大包号
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string? MasterPackageNumber { get; set; }
        
        /// <summary>
        /// 中性面单单号
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string NeutralWaybillNumber { get; set; }
        
        /// <summary>
        /// 客户ID（关联customers表）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? CustomerId { get; set; }
        
        /// <summary>
        /// 导入时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime ImportedAt { get; set; } = DateTime.UtcNow;
        
        /// <summary>
        /// 导入人/系统
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = false)]
        public string ImportedBy { get; set; } = "System";
        
        /// <summary>
        /// 数据状态（Y: 有效, N: 无效）
        /// </summary>
        [SugarColumn(Length = 1, DefaultValue = "Y")]
        public string Status { get; set; } = "Y";
    }
}