# BlacklistNotifyConfigTypeEnum.java

    package cloud.wconnect.frontoffice.cons.badguest;

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

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

    /**
     * 黑名单通知配置类型枚举类
     *
     * @author lichen
     * @date 2024/11/14
     */
    @AllArgsConstructor
    @Getter
    public enum BlacklistNotifyConfigTypeEnum {

        /**
         * 审批通知
         */
        WAIT_FOR_APPROVING(1, NotifySubjectI18nCons.WAITING_FOR_APPROVAL),
        /**
         * 黑名单客人入住
         */
        BLACK_LIST_CHECKED_IN(2, "blacklist.notify.subject.checked-in"),
        /**
         * Arrivals Detailed/service 报告缺失
         */
        ARRIVALS_DETAILED_REPORT_MISSED(3, NotifySubjectI18nCons.MISSING_REPORT),
        /**
         * Guest-In-House/service 报告缺失
         */
        GUEST_IN_HOUSE_REPORT_MISSED(4, NotifySubjectI18nCons.MISSING_REPORT),
        /**
         * Reservations – made Yesterday/service 报告缺失
         */
        RESERVATIONS_MADE_YESTERDAY_REPORT_MISSED(5, NotifySubjectI18nCons.MISSING_REPORT);

        /**
         * 通知类型
         */
        private int type;

        /**
         * 默认通知主题的国际化code
         */
        private String defaultSubjectI18nCode;

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

        }