# HotelKpiReportCategoryEnum.java

    package cloud.wconnect.workperformance.cons.hotelkpi;

    import lombok.AllArgsConstructor;
    import lombok.Getter;
    import org.apache.commons.lang3.StringUtils;

    import java.util.Arrays;

    /**
     * Cons: Hotel KPI Report Type
     *
     * @author zc
     * @date 2024/07/01
     */
    @Getter
    @AllArgsConstructor
    public enum HotelKpiReportCategoryEnum {

        HISTORY_AND_FORECAST(HotelKpiNotifyTypeEnum.MISSING_REPORT_HISTORY_AND_FORECAST.getType(), "-30,100"),
        MANAGER_FLASH(HotelKpiNotifyTypeEnum.MISSING_REPORT_MANAGER_FLASH.getType(), "-1,-1"),
        HISTORY_AND_FORECAST_BUSINESS_BLOCK(HotelKpiNotifyTypeEnum.MISSING_REPORT_HISTORY_AND_FORECAST_BUSINESS_BLOCK.getType(), "-30,100");

        /**
         * 报告分类
         */
        private final int category;
        /**
         * 报告数据范围
         */
        private final String dateRange;

        /**
         * Get date range
         *
         * @param category category
         * @return date range
         */
        public static String getDateRange(int category) {
            return Arrays.stream(HotelKpiReportCategoryEnum.values()).filter(value ->
                            value.getCategory() == category).findFirst().map(HotelKpiReportCategoryEnum::getDateRange)
                    .orElse(StringUtils.EMPTY);
        }
    }