# PastReservationSchedulerDTO.java

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

    import cloud.wconnect.commonlib.annotation.validator.inlist.InList;
    import lombok.Data;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.constraints.NotBlank;
    import jakarta.validation.constraints.NotNull;

    /**
     * DTO：scheduler
     *
     * @author: yyt
     * 2024-10-2
     */
    @Data
    public class PastReservationSchedulerDTO {

        /**
         * 定时任务 id
         */
        private String id;

        /**
         * 类型 (1：guest in house 报告缺失，2：连续入住通知，4：credit limit 报告缺失)
         */
        @NotNull(message = "the category must not be null")
        @InList(intValue = {1, 2, 4}, message = "the category must in [1: guest in house report missing, 2: notify consecutive stay, 4: credit limit report missing]")
        private Integer category;

        public static final int MISSING_REPORT_GUEST_IN_HOUSE = 1;

        public static final int NOTIFY_CONSECUTIVE_STAY = 2;

        public static final int MISSING_REPORT_CREDIT_LIMIT = 4;

        /**
         * 触发时间规则（1：报告缺失，目前只支持按照天执行；2：连续入住通知，支持按照 天 / 周 / 月 执行；
         * 样例：{"everyMonth":{"day":1,"hour":1,"minute":2}},{"everyWeek":{"dayOfWeek":1,"hour":1,"minute":2}},{"everyDay":{"hour":1,"minute":2}}）
         */
        @NotBlank(message = "the scheduler must not be blank")
        private String scheduler;

        /**
         * 开始时间，0表示立即生效
         */
        @NotNull(message = "the startDate must not be null")
        private Long startDate;

        /**
         * 0:停止；1:启动；
         */
        @NotNull(message = "the status must not be null")
        @Range(min = 0, max = 1, message = "the status must in [0:stop, 1:start]")
        private Integer status;

        /**
         * 拓展参数
         * category 为报告缺失时，该json为：{"threshold": 240 }，threshold表示数据过期条件，单位为分钟。
         * 上述的业务含义为：假设定时任务触发时间为：2024-03-04 00:01:00触发定时任务后，检查最后一次报告导入的时刻，如果距离当前时间超过了240分钟，则视为报告缺失；category 非报告缺失时，该json为空
         */
        private String parameters;

    }