# DailyRevenueNotifyTypeEnum.java

    package cloud.wconnect.rateshop.cons.revenue;

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

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

    /**
     * Enum: Notify Type
     *
     * @author zc
     * @date 2024/11/15
     */
    @Getter
    @AllArgsConstructor
    public enum DailyRevenueNotifyTypeEnum {

        MISSING_REPORT_HISTORY_FORECAST(RevenueImportCons.HISTORY_FORECAST, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_FORECAST_BUSINESS_BLOCK(RevenueImportCons.HISTORY_FORECAST_BUSINESS_BLOCK, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_RESERVATION_STATISTIC(RevenueImportCons.RESERVATION_STATISTIC, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_RESERVATION_FORECAST(RevenueImportCons.RESERVATION_FORECAST, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_RESERVATION_FORECAST_NEXT_MONTH(RevenueImportCons.RESERVATION_FORECAST_NEXT_MONTH, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_FORECAST_NEXT_MONTH(RevenueImportCons.HISTORY_FORECAST_NEXT_MONTH, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_RESERVATION_FORECAST_NEXT_14_DAYS(RevenueImportCons.RESERVATION_FORECAST_NEXT_14_DAYS, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_AND_FORECAST_YESTERDAY_AND_NEXT_NINETY_DAYS(RevenueImportCons.HISTORY_AND_FORECAST_YESTERDAY_AND_NEXT_NINETY_DAYS, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_MARKET_CODE(RevenueImportCons.MARKET_CODE, NotifySubjectI18nCons.MISSING_REPORT),

        OCC_JUMP_ALERT(RevenueImportCons.OCC_JUMP_ALERT, "daily-revenue.notify.subject.occ-jump-alert"),

        MISSING_REPORT_HISTORY_FORECAST_THIS_MONTH_FUTURE(RevenueImportCons.HISTORY_FORECAST_THIS_MONTH_FUTURE, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_FORECAST_NEXT_MONTH_FUTURE(RevenueImportCons.HISTORY_FORECAST_NEXT_MONTH_FUTURE, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_FORECAST_THIS_MONTH_AFTER_NEXT_FUTURE(RevenueImportCons.HISTORY_FORECAST_THIS_MONTH_AFTER_NEXT_FUTURE, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_RESERVATION_FORECAST_NEXT_90_DAYS(RevenueImportCons.RESERVATION_FORECAST_NEXT_90_DAYS, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_HISTORY_FORECAST_BUSINESS_BLOCK_NEXT_90_DAYS(RevenueImportCons.HISTORY_FORECAST_BUSINESS_BLOCK_NEXT_90_DAYS, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_MANAGER_FLASH(RevenueImportCons.MANAGER_FLASH, NotifySubjectI18nCons.MISSING_REPORT),

        MISSING_REPORT_DETAILED_AVAILABILITY(RevenueImportCons.DETAILED_AVAILABILITY_NEXT_14_DAYS, NotifySubjectI18nCons.MISSING_REPORT),

        RATE_REVIEW_NOTIFY(RevenueImportCons.RATE_REVIEW, "daily-revenue.notify.subject.rate-review-notify"),

        MISSING_REPORT_GROUP_PICKUP(RevenueImportCons.GROUP_PICKUP_YESTERDAY, NotifySubjectI18nCons.MISSING_REPORT),

        HISTORY_AND_FORECAST_FROM_THIRTY_DAYS_AGO_TO_YESTERDAY(RevenueImportCons.HISTORY_AND_FORECAST_FROM_THIRTY_DAYS_AGO_TO_YESTERDAY, NotifySubjectI18nCons.MISSING_REPORT);

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

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