using System.ComponentModel.DataAnnotations; using Oms.Domain.CustomersAggregate.Enums; namespace Oms.Application.Dtos.Customers; /// /// 创建客户入参。 /// public class CreateCustomerInput { /// /// 客户编号(留空时系统自动生成,规则:年码+月码+序号,如 AF0A1)。 /// [StringLength(32)] public string? CustomerCode { get; set; } /// /// 客户名称。 /// [Required] [StringLength(128)] public string CustomerName { get; set; } = string.Empty; /// /// 手机号。 /// [Required] [StringLength(16)] public string Phone { get; set; } = string.Empty; /// /// 邮箱。 /// [Required] [EmailAddress] [StringLength(64)] public string Email { get; set; } = string.Empty; /// /// 微信头像地址。 /// [StringLength(255)] public string? WechatAvatar { get; set; } /// /// 微信昵称。 /// [StringLength(64)] public string? WechatNickname { get; set; } /// /// 密码。 /// [Required] [StringLength(64, MinimumLength = 6)] public string Password { get; set; } = string.Empty; /// /// 账户余额。 /// [Range(typeof(decimal), "0", "999999999999")] public decimal Balance { get; set; } /// /// 总额度。 /// [Range(typeof(decimal), "0", "999999999999")] public decimal TotalQuota { get; set; } /// /// 已用额度。 /// [Range(typeof(decimal), "0", "999999999999")] public decimal UsedQuota { get; set; } /// /// 状态。 /// public CustomerStatus Status { get; set; } = CustomerStatus.Normal; /// /// 备注。 /// [StringLength(512)] public string? Remark { get; set; } /// /// 销售人员。 /// [StringLength(32)] public string? Salesman { get; set; } /// /// 所属顾问。 /// [StringLength(32)] public string? CustomerService { get; set; } /// /// 客户分组(遗留字段,计价优先 MemberLevelId)。 /// public CustomerGroup? CustomerGroup { get; set; } /// /// 会员等级 Id。 /// public int? MemberLevelId { get; set; } /// /// 价区键(卖价 CustomerGroupValues JSON 键)。空则默认「普通会员」。 /// [StringLength(64)] public string? PriceTierKey { get; set; } /// /// 注册邀请码(引荐绑定,仅新客户有效)。 /// [StringLength(16)] public string? InviteCode { get; set; } /// /// 顾问邀请码(所属顾问绑定,值为员工 Account;仅 CustomerService 为空时生效)。 /// [StringLength(64)] public string? AdvisorCode { get; set; } }