# AdjTypeEnum.java

    package cloud.wconnect.frontoffice.cons.adjustment;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * @author lichen
     * @description Adjustment Requests的Request Type 枚举类
     * 类型(1:Sales 2:Front Desk 3:Accounting 4:Misposting)
     * @date 2023/3/30 13:43
     */
    @Getter
    @AllArgsConstructor
    public enum AdjTypeEnum {

        SALES(1, "adjustment.type.sales"),
        FRONT_DESK(2, "adjustment.type.front_desk"),
        ACCOUNTING(3, "adjustment.type.accounting"),
        MISPOSTING(4, "adjustment.type.misposting"),
        CHARGEBACK(5, "adjustment.type.chargebacks");

        private int adjType;

        /**
         * 国际化的code
         */
        private String i18nCode;

        /**
         * 获取国际化code
         *
         * @param type 类型
         * @return java.lang.String
         * @author lichen
         * @date 2024/1/11
         */
        public static String getI18nCode(int type) {
            Optional<AdjTypeEnum> optional = Arrays.stream(AdjTypeEnum.values())
                    .filter(item -> item.getAdjType() == type).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }
    }