# CaseStatusEnum.java

    package cloud.wconnect.finance.cons.chargeback;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * @author yyt
     * 2023/8/29
     */
    @AllArgsConstructor
    @Getter
    public enum CaseStatusEnum {

        /**
         * Draft
         */
        DRAFT(1, "chargeback.draft"),

        /**
         * Ignored
         */
        IGNORED(3, "chargeback.ignored"),

        /**
         * Accept
         */
        ACCEPT(4, "chargeback.accept"),

        /**
         * Dispute
         */
        DISPUTE(5, "chargeback.dispute"),

        /**
         * Processed
         */
        PROCESSED(6, "chargeback.processed"),

        /**
         * Win
         */
        WIN(7, "chargeback.win"),

        /**
         * Loss
         */
        LOSS(8, "chargeback.loss"),

        /**
         * Frozen
         */
        FROZEN(9, "chargeback.frozen"),

        /**
         * Close
         */
        CLOSE(12, "chargeback.close"),

        /**;
         * Fill out Adj Form
         */
        FILL_OUT_ADJ(13, "chargeback.fillOutAdj");

        private final int code;

        private final String desc;

        public static String getStatusDesc(Integer status) {
            Optional<CaseStatusEnum> optional = Arrays.stream(values()).filter(item -> item.code == status).findFirst();
            return optional.isPresent() ? optional.get().getDesc() : "";
        }

    }