using FluentValidation;
using Hotline.Share.Dtos.Order;

namespace Hotline.Validators.Order;

public class AddOrderDtoValidator : AbstractValidator<AddOrderDto>
{
    //新增验证
    public AddOrderDtoValidator()
    {
        RuleFor(d => d.Content).NotEmpty().WithMessage("请填写工单内容");

        #region 医疗服务中心受理单

        RuleFor(d => d.OrderExtension.MedName).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("医院名称最多200字符");
        RuleFor(d => d.OrderExtension.MedAddress).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("医院地址最多500字符");
        RuleFor(d => d.OrderExtension.MedDepartment).MaxLengthWithChineseChar(100).When(d => d.OrderExtension != null).WithMessage("科室最多100字符");
        RuleFor(d => d.OrderExtension.MedDoctor).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("医生最多50字符");
        RuleFor(d => d.OrderExtension.MedPatient).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("病人姓名最多200字符");
        RuleFor(d => d.OrderExtension.MedNo).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("就诊卡号最多50字符");
        RuleFor(d => d.OrderExtension.MedIdNo).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("身份证号最多50字符");
        #endregion

        #region 电视购物及商铺购买退换货中心受理单
        RuleFor(d => d.OrderExtension.ExchTv).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("电视台（商铺）最多50字符");
        RuleFor(d => d.OrderExtension.ExchProduct).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("产品名称最多200字符");
        RuleFor(d => d.OrderExtension.ExchName).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("商家名称最多200字符");
        RuleFor(d => d.OrderExtension.ExchAddress).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("商家地址最多500字符");
        RuleFor(d => d.OrderExtension.ExchConsignee).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("收货人最多200字符");
        RuleFor(d => d.OrderExtension.ExchConsigneeAddress).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("收货地址最多200字符");
        #endregion

        #region 高速公路投诉中心受理单
        RuleFor(d => d.OrderExtension.ExpwyEntrance).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("高速入口最多200字符");
        RuleFor(d => d.OrderExtension.ExpwyExit).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("高速出口最多200字符");
        RuleFor(d => d.OrderExtension.ExpwyNo).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("高速入口最多50字符");
        #endregion

        #region 电视台虚假广告中心受理单
        RuleFor(d => d.OrderExtension.AdTv).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("电视台最多50字符");
        RuleFor(d => d.OrderExtension.AdProduct).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("产品名称最多200字符");
        #endregion

        #region 四川政务服务网技术中心受理单

        RuleFor(d => d.OrderExtension.ZwfwwAccount).MaxLengthWithChineseChar(20).When(d => d.OrderExtension != null).WithMessage("服务账号最多20字符");
        RuleFor(d => d.OrderExtension.ZwfwwContact).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("联系方式最多50字符");
        #endregion

        #region 四川省12366热线诉求交办单
        RuleFor(d => d.OrderExtension.Location12366Sq).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("主管税务机关最多500字符");
        RuleFor(d => d.OrderExtension.Info12366Sq).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("被投诉单位或个人信息最多200字符");
        RuleFor(d => d.OrderExtension.Type12366Sq).MaxLengthWithChineseChar(10).When(d => d.OrderExtension != null).WithMessage("投诉类型最多10字符");
        #endregion

        #region 四川省12366热线咨询交办单
        RuleFor(d => d.OrderExtension.Location12366Zx).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("主管税务机关最多500字符");
        RuleFor(d => d.OrderExtension.Info12366Zx).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("被投诉单位或个人信息最多200字符");
        #endregion

        #region 12328服务监督中心受理单
        RuleFor(d => d.OrderExtension.AcceptType12328).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("受理方式最多50字符");
        RuleFor(d => d.OrderExtension.Client12328).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("客户最多200字符");
        #endregion

        #region 邮政业消费者申诉受理单
        RuleFor(d => d.OrderExtension.MailClaimantName).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("申诉人姓名最多50字符");
        RuleFor(d => d.OrderExtension.MailClaimantPhone).MaxLengthWithChineseChar(12).When(d => d.OrderExtension != null).WithMessage("申诉人电话最多12字符");
        RuleFor(d => d.OrderExtension.MailClaimantEnterprise).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("申诉企业最多200字符");
        RuleFor(d => d.OrderExtension.MailSenderName).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("寄件人姓名最多50字符");
        RuleFor(d => d.OrderExtension.MailSenderPhone).MaxLengthWithChineseChar(12).When(d => d.OrderExtension != null).WithMessage("寄件人电话最多12字符");
        RuleFor(d => d.OrderExtension.MailSenderAddress).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("寄件人地址最多500字符");
        RuleFor(d => d.OrderExtension.MailReceiverName).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("收件人姓名最多50字符");
        RuleFor(d => d.OrderExtension.MailReceiverPhone).MaxLengthWithChineseChar(12).When(d => d.OrderExtension != null).WithMessage("收件人电话最多12字符");
        RuleFor(d => d.OrderExtension.MailReceiverAddress).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("收件人地址最多500字符");
        #endregion

        #region 环保举报业务受理单
        RuleFor(d => d.OrderExtension.EpEmail).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("邮箱最多50字符");
        RuleFor(d => d.OrderExtension.EpAddress).MaxLengthWithChineseChar(500).When(d => d.OrderExtension != null).WithMessage("通讯地址最多500字符");
        RuleFor(d => d.OrderExtension.EpObject).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("举报对象最多200字符");
        RuleFor(d => d.OrderExtension.EpObjectAddress).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("详细地址最多200字符");
        RuleFor(d => d.OrderExtension.EpIndustryType).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("行业类型最多50字符");
        RuleFor(d => d.OrderExtension.EpKeyPoint).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("重点要素最多50字符");
        #endregion

        #region 投诉人信息
        RuleFor(d => d.OrderExtension.LicenceTypeCode).MaxLengthWithChineseChar(10).When(d => d.OrderExtension != null).WithMessage("证件类型最多10字符");
        RuleFor(d => d.OrderExtension.LicenceType).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("证件类型名称最多50字符");
        RuleFor(d => d.OrderExtension.IdentityTypeCode).MaxLengthWithChineseChar(4).When(d => d.OrderExtension != null).WithMessage("提供方类型最多4字符");
        RuleFor(d => d.OrderExtension.IdentityType).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("提供方类型名称最多50字符");
        RuleFor(d => d.OrderExtension.IdentityCode).MaxLengthWithChineseChar(10).When(d => d.OrderExtension != null).WithMessage("提供方身份最多10字符");
        RuleFor(d => d.OrderExtension.Identity).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("提供方身份名称最多50字符");
        RuleFor(d => d.OrderExtension.NationalityCode).MaxLengthWithChineseChar(1).When(d => d.OrderExtension != null).WithMessage("国籍最多1字符");
        RuleFor(d => d.OrderExtension.Nationality).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("国籍名称最多50字符");
        RuleFor(d => d.OrderExtension.NationCode).MaxLengthWithChineseChar(4).When(d => d.OrderExtension != null).WithMessage("民族最多4字符");
        RuleFor(d => d.OrderExtension.Nation).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("民族名称最多50字符");
        RuleFor(d => d.OrderExtension.LicenceNo).MaxLengthWithChineseChar(64).When(d => d.OrderExtension != null).WithMessage("证件号码最多64字符");
        RuleFor(d => d.OrderExtension.PostalCode).MaxLengthWithChineseChar(10).When(d => d.OrderExtension != null).WithMessage("邮政编码最多10字符");
        RuleFor(d => d.OrderExtension.Email).MaxLengthWithChineseChar(100).When(d => d.OrderExtension != null).WithMessage("电子邮箱最多100字符");
        RuleFor(d => d.OrderExtension.OtherContact).MaxLengthWithChineseChar(64).When(d => d.OrderExtension != null).WithMessage("其他联系方式最多64字符");
        #endregion

        #region 投诉对象信息
        RuleFor(d => d.OrderExtension.EnterpriseName).MaximumLength(30).When(d => d.OrderExtension != null).WithMessage("企业名称最多30字符");
        RuleFor(d => d.OrderExtension.UnifiedSocialCreditCode).MaxLengthWithChineseChar(30).When(d => d.OrderExtension != null).WithMessage("统一社会信用代码最多30字符");
        RuleFor(d => d.OrderExtension.RegisterAddress).MaximumLength(30).When(d => d.OrderExtension != null).WithMessage("企业注册地址最多30字符");
        RuleFor(d => d.OrderExtension.RegisterNumber).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("注册号最多50字符");
        RuleFor(d => d.OrderExtension.EnterpriseContact).MaxLengthWithChineseChar(70).When(d => d.OrderExtension != null).WithMessage("联系人最多70字符");
        RuleFor(d => d.OrderExtension.MarketTypeCode).MaxLengthWithChineseChar(64).When(d => d.OrderExtension != null).WithMessage("市场主体类型代码最多64字符");
        RuleFor(d => d.OrderExtension.MarketType).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("市场主体类型名称最多200字符");
        RuleFor(d => d.OrderExtension.IndustryClassifyCode).MaxLengthWithChineseChar(64).When(d => d.OrderExtension != null).WithMessage("行业类型代码最多64字符");
        RuleFor(d => d.OrderExtension.IndustryClassify).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("行业类型名称最多200字符");
        #endregion

        #region 投诉详情
        RuleFor(d => d.OrderExtension.ExternalOrderNo).MaxLengthWithChineseChar(45).When(d => d.OrderExtension != null).WithMessage("订单号最多45字符");
        RuleFor(d => d.OrderExtension.Patentee).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("专利权人最多50字符");
        RuleFor(d => d.OrderExtension.PatentName).MaxLengthWithChineseChar(200).When(d => d.OrderExtension != null).WithMessage("专利名称最多200字符");
        RuleFor(d => d.OrderExtension.PatentNo).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("专利号最多50字符");
        RuleFor(d => d.OrderExtension.ProductName).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("产品名称最多50字符");
        RuleFor(d => d.OrderExtension.ApprovalNumber).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("批准文号最多50字符");
        RuleFor(d => d.OrderExtension.ProductBatchNo).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("产品批号最多50字符");
        RuleFor(d => d.OrderExtension.ProductStandard).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("产品规格最多50字符");
        RuleFor(d => d.OrderExtension.Manufacturer).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("生产厂家最多50字符");
        RuleFor(d => d.OrderExtension.SalesEnterprise).MaxLengthWithChineseChar(50).When(d => d.OrderExtension != null).WithMessage("销售企业最多50字符");
        RuleFor(d => d.OrderExtension.ConsumerAddress).MaximumLength(30).When(d => d.OrderExtension != null).WithMessage("消费者地址最多30字符");
        RuleFor(d => d.OrderExtension.BusinessPosition.Street).MaxLengthWithChineseChar(100).When(d => d.OrderExtension != null && d.OrderExtension.BusinessPosition != null).WithMessage("经营详细地址最多100字符");
        #endregion
    }

}

