# BlacklistReasonEnum.java

    package cloud.wconnect.frontoffice.cons.badguest;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * 黑名单原因枚举类
     *
     * @author lichen
     * @date 2025/5/19
     */
    @AllArgsConstructor
    @Getter
    public enum BlacklistReasonEnum {

        /**
         * 信用卡诈骗
         */
        CREDIT_CARD_FRAUD("Credit Card Fraud","blacklist.chargeback.reason.creditCardFraud"),
        /**
         * 罰款/其他費用
         */
        PENALTY_FINE_OTHER_FEE("Penalty / Fine / Other Fee","blacklist.chargeback.reason.penaltyFineOtherFee");

        /**
         * 类型
         */
        private String type;
        /**
         * 国际化code
         */
        private String i18nCode;

        /**
         * 根据原因获取国际化code
         *
         * @param caseReasonType 原因类型
         * @return java.lang.String
         * @author lichen
         * @date 2025/5/19
         */
        public static String getI18nCodeByType(String caseReasonType) {
            Optional<BlacklistReasonEnum> optional = Arrays.stream(BlacklistReasonEnum.values()).filter(item -> item.type.equals(caseReasonType)).findFirst();
            return optional.isEmpty() ? "" : optional.get().getI18nCode();
        }
    }