using System;
using SqlSugar;

namespace MDL.Models
{
    /// <summary>
    /// 收货扫描记录实体类，映射到数据库表
    /// </summary>
    [SugarTable("arrival_scan_records")]
    public class ArrivalScanRecordEntity
    {
        /// <summary>
        /// 主键ID，自增
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// PDA扫描的大箱号（到货编号）
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string ArrivalNumber { get; set; }

        /// <summary>
        /// 客户ID（冗余字段，关联customers表）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? CustomerId { 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>
        /// PDA收货扫描时间（创建时间）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

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