package com.jsowell.common.enums.uniapp;

import com.jsowell.common.enums.ykc.StopChargingFailedReasonEnum;

/**
 * 用户账户余额Enum
 *
 * @author JS-ZZA
 * @date 2022/11/26 11:34
 */
public enum BalanceChangesEnum {
    /**
     * 进账
     */
    CODE_RECHARGE("10", "充值"),

    CODE_PRESENTED("11", "赠送"),

    CODE_ORDER_SETTLEMENT_REFUND("12", "订单结算退款"),


    /**
     * 出账
     */
    CODE_SYSTEM_DEDUCTIONS("20", "后管扣款"),

    CODE_ORDER_PAYMENT("21", "订单付款"),

    CODE_USER_REFUND("22", "用户退款"),
    ;
    private String code;
    private String value;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    BalanceChangesEnum(String code, String value) {
        this.value = value;
        this.code = code;
    }

    /**
     * 根据code获取value
     * @param code
     * @return
     */
    public static String getValueByCode(String code) {
        for (BalanceChangesEnum item : BalanceChangesEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getValue();
            }
        }
        return null;
    }


}
