# AdjustmentStatusEnum.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的状态枚举类
     * 状态0: ignore 1:draft 2:inactive 3:active 4:archived
     * @date 2023/3/30 11:44
     */
    @Getter
    @AllArgsConstructor
    public enum AdjustmentStatusEnum {

        /**
         * 无效
         */
        INVALID(0,"adjustment.status.invalid"),
        /**
         * 有效
         */
        VALID(1,"adjustment.status.valid"),
        /**
         * 待定
         */
        UNDETERMINED(2,"adjustment.status.undetermined"),
        /**
         * 作废
         */
        CANCEL(3,"adjustment.status.cancel");

        private int status;

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

        /**
         * 获取状态对应的国际化code
         *
         * @param status 状态
         * @return java.lang.String
         * @author lichen
         * @date 2024/1/11
         */
        public static String getI18nCode(int status) {
            Optional<AdjustmentStatusEnum> optional = Arrays.stream(AdjustmentStatusEnum.values())
                    .filter(item -> item.getStatus() == status).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }

    }