using System;
using SqlSugar;

namespace MDL.Models
{
    /// <summary>
    /// 客户资料表
    /// </summary>
    [SugarTable("customers")]
    public class CustomerEntity
    {
        /// <summary>
        /// 主键ID，自增
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 客户代码（唯一标识）
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "客户代码")]
        public string CustomerCode { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "客户名称")]
        public string CustomerName { get; set; }

        /// <summary>
        /// 联系人姓名
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "联系人姓名")]
        public string ContactName { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(Length = 20, IsNullable = true, ColumnDescription = "联系电话")]
        public string ContactPhone { get; set; }

        /// <summary>
        /// 联系邮箱
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "联系邮箱")]
        public string ContactEmail { get; set; }

        /// <summary>
        /// 客户状态（Y: 启用, N: 禁用）
        /// </summary>
        [SugarColumn(Length = 1, DefaultValue = "Y", IsNullable = false, ColumnDescription = "客户状态")]
        public string Status { get; set; } = "Y";

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

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

        /// <summary>
        /// 备注信息
        /// </summary>
        [SugarColumn(Length = 500, IsNullable = true, ColumnDescription = "备注信息")]
        public string Remark { get; set; }
    }
}