# PastReservationEmailConfigDTO.java

    package cloud.wconnect.frontoffice.pojo.dto.pastreservation;

    import cloud.wconnect.commonlib.annotation.validator.inlist.InList;
    import jakarta.validation.Valid;
    import jakarta.validation.constraints.NotNull;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import org.hibernate.validator.constraints.Length;

    import java.util.List;

    /**
     * DTO: Email Config
     *
     * @author yyt
     * 2024/10/2
     */
    @Data
    @NoArgsConstructor
    public class PastReservationEmailConfigDTO {

        /**
         * 数据 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：guest in house 报告缺失，2：连续入住通知，4：credit limit 报告缺失)
         */
        @NotNull(message = "the type must not be null")
        @InList(intValue = {1, 2, 4}, message = "the type must in [1: guest in house report missing, 2: notify consecutive stay, 4: credit limit report missing]")
        private Integer type;

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

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

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

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

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

    }