
package com.tmerclub.cloud.order.constant;


/**
 * 平台介入退款方式 1.商家承担 2.商家供应商承担（供应商发货订单） 3.不同意退款
 *
 * @author lhd
 */
public enum RefundInterventionType {

    /**
     * 商家承担
     */
    SHOP(1, "商家承担"),

    /**
     * 商家供应商承担（供应商发货订单）
     */
    COMMON(2, "商家供应商承担（供应商发货订单）"),

    /**
     * 不同意退款
     */
    ORDER_REFUND(3, "不同意退款");

    private final Integer num;

    private final String shopWalletChangeReason;

    public Integer value() {
        return num;
    }

    public String getShopWalletChangeReason() {
        return shopWalletChangeReason;
    }

    RefundInterventionType(Integer num, String shopWalletChangeReason) {
        this.num = num;
        this.shopWalletChangeReason = shopWalletChangeReason;
    }

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

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