
package com.tmerclub.cloud.supplier.constant;


/**
 * 供应商钱包金额发生改变的原因
 * 0用户支付 1用户确认收货 2 用户退款申请 3 拒绝用户退款申请 4 提现申请 5 提现申请被拒绝
 *
 * @author tmerclub
 */
public enum SupplierWalletChangeReason {

    /**
     * 用户支付
     */
    PAY(0, "用户支付"),

    /**
     * 订单结算
     */
    SETTLED(1, "订单结算"),

    /**
     * 用户退款申请成功
     */
    ORDER_REFUND(2, "用户退款申请成功"),


    /**
     * 提现申请
     */
    APPLY_CASH(4, "提现申请"),

    /**
     * 提现申请被拒绝
     */
    REFUSE_CASH(5, "提现申请被拒绝"),

    /**
     * 通过提现申请
     */
    PASS_CASH(6, "提现申请通过"),

    /**
     * 系统发放成功
     */
    SUCCESS_CASH(7, "系统发放成功"),
    /**
     * 提现发放失败
     */
    FAIL_CASH(8, "系统发放失败"),

    /**
     * 系统扣除订单中需要颁发给用户的分销金额
     */
    DISTRIBUTION_AMOUNT(9, "扣除订单分销金额"),

    ;

    private final Integer num;

    private final String supplierWalletChangeReason;

    public Integer value() {
        return num;
    }

    public String getSupplierWalletChangeReason() {
        return supplierWalletChangeReason;
    }

    SupplierWalletChangeReason(Integer num, String supplierWalletChangeReason) {
        this.num = num;
        this.supplierWalletChangeReason = supplierWalletChangeReason;
    }

    public static SupplierWalletChangeReason instance(Integer value) {
        SupplierWalletChangeReason[] enums = values();
        for (SupplierWalletChangeReason statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static String getReason(Integer value) {
        SupplierWalletChangeReason[] enums = values();
        for (SupplierWalletChangeReason statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum.supplierWalletChangeReason;
            }
        }
        return null;
    }
}
