# CbCaseEmailConfigDTO.java

    package cloud.wconnect.finance.pojo.dto.chargeback;

    import lombok.Data;
    import lombok.NoArgsConstructor;
    import org.hibernate.validator.constraints.Length;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.Valid;
    import jakarta.validation.constraints.NotNull;
    import java.util.List;

    /**
     * DTO: Cb Case Email Config
     *
     * @author yyt
     * 2023/8/24
     */
    @Data
    @NoArgsConstructor
    public class CbCaseEmailConfigDTO {

        /**
         * 数据 id
         */
        private Integer id;

        /**
         * 资产 id
         */
        private Integer propertyId;

        /**
         * 邮件主题
         */
        @NotNull(message = "the subject must not be null")
        @Length(max = 200, message = "the subject max length is 200")
        private String subject;

        /**
         * 默认主题
         */
        private String defaultSubject;

        /**
         * 邮件配置类型(1：报告缺失，2：超期 replay by 通知，3：初始阶段审批通知主题配置，4：酒店表态阶段审批通知主题配置，
         * 5：overdue 阶段审批通知主题配置，6：portal 阶段审批通知主题配置，7：loss-adj 阶段审批通知主题配置，8：last 阶段审批通知主题配置)
         */
        @NotNull(message = "the type must not be null")
        @Range(min = 1, max = 8, message = "the type must in [1: report missing, 2: notify over time, " +
                "3: Approval notification subject configuration in initial stage, " +
                "4: Approval notification subject configuration in hotel operations stage, " +
                "5: Approval notification subject configuration in overdue stage, " +
                "6: Approval notification subject configuration in portal stage, " +
                "7: Approval notification subject configuration in loss-adj stage, " +
                "8: Approval notification subject configuration in last stage]")
        private Integer type;

        /**
         * 收件人
         */
        @Valid
        private List<CbCaseEmailTargetDTO> toList;

        /**
         * 抄送人
         */
        @Valid
        private List<CbCaseEmailTargetDTO> ccList;

        /**
         * 状态（false：关闭，true：开启）
         */
        @NotNull(message = "the status must not be null")
        private Boolean status;

        public void setSubject(String subject) {
            this.subject = subject.trim();
        }

        public CbCaseEmailConfigDTO(String defaultSubject) {
            this.defaultSubject = defaultSubject;
        }

    }