# DbNotifyTypeEnum.java

    package cloud.wconnect.workperformance.cons.database;

    import cloud.wconnect.commonlib.cons.NotifySubjectI18nCons;
    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * Enum: Database Notify Type
     *
     * @author zc
     * @date 2025/12/02
     */
    @Getter
    @AllArgsConstructor
    public enum DbNotifyTypeEnum {

        // 1. Manager Flash ~ -1d
        MISSING_REPORT_MANAGER_FLASH_LAST_1_DAY(1, NotifySubjectI18nCons.MISSING_REPORT),
        // 2. Manager Flash ~ -2d
        MISSING_REPORT_MANAGER_FLASH_LAST_2_DAY(2, NotifySubjectI18nCons.MISSING_REPORT),
        // 3. Market Code Statistics ~ -1d
        MISSING_REPORT_MARKET_CODE_STATISTICS_LAST_1_DAY(3, NotifySubjectI18nCons.MISSING_REPORT),
        // 4. Market Code Statistics ~ -2d
        MISSING_REPORT_MARKET_CODE_STATISTICS_LAST_2_DAY(4, NotifySubjectI18nCons.MISSING_REPORT),
        // 5. History and Forecast -2d ~ 365d
        MISSING_REPORT_HF_LAST_2_DAY_TO_365_DAY(5, NotifySubjectI18nCons.MISSING_REPORT),
        // 6. Occupancy Summary -2d ~ -1d
        MISSING_REPORT_OS_LAST_2_DAY_TO_LAST_1_DAY(6, NotifySubjectI18nCons.MISSING_REPORT),
        // 7. Market Segment Summary -2d ~ -1d
        MISSING_REPORT_MSS_LAST_2_DAY_TO_LAST_1_DAY(7, NotifySubjectI18nCons.MISSING_REPORT);

        /**
         * 通知类型
         */
        private final Integer type;
        /**
         * 默认通知主题的国际化code
         */
        private final String defaultSubjectI18nCode;

        /**
         * 根据类型获取默认主题的国际化code
         *
         * @param type 类型
         * @return java.lang.String
         * @author zc
         * @date 2025/12/02
         */
        public static String getDefaultSubjectI18nCode(int type) {
            Optional<DbNotifyTypeEnum> optional = Arrays.stream(DbNotifyTypeEnum.values())
                    .filter(item -> item.getType() == type).findFirst();
            return optional.isEmpty() ? "" : optional.get().getDefaultSubjectI18nCode();
        }
    }