package com.ruoyi.enums;

import java.util.Arrays;

/**
 * 提现记录枚举
 * @Author liwenlong
 */
public enum WalletDetailEnums {

    /**
     * 佣金收益(销售佣金)
     */
    TEAM_COMMISSION(1, "佣金收益"),

    /**
     * 提现申请扣除
     */
    WITH_DEDU(2, "提现申请扣除"),

    /**
     * 提现失败返还
     */
    WITH_FAIL_RETURN(3, "提现失败返还"),

    /**
     * 充值余额
     */
    RECHARGE_BALANCE(4, "充值余额"),

    /**
     * 订单支付
     */
    ORDER_PAY(5, "订单支付"),

    /**
     * 平台转入
     */
    PLAT_ADD(6, "平台转入"),

    /**
     * 平台扣除
     */
    PLAT_SUB(7, "平台扣除"),


    /**
     * 订单收入（表现师）
     */
    ORDER_INCOME(8, "订单收入"),

    /**
     * 订单退款
     */
    ORDER_RETURN(9, "订单退款"),

    /**
     * 订单支付
     */
    PLATFORM_AUTH_PAY(10, "平台认证支付"),

    HEIGHT_AUTH_PAY(11, "高端认证支付"),

    BOND_PAY(12, "保证金支付"),

    RECHARGE_GIVE_BALANCE(13, "充值赠送抵用金"),

    ADJUST_PRICE_PAY(14, "订单调价"),

    DEPOSIT_REFUND(15, "定金退还"),


    GIVE_ORDER_PAY(16, "抵用金支付"),

    MALL_ORDER_PAY(17, "商城订单支付"),

    /**
     * 订单退款
     */
    GIVE_ORDER_RETURN(18, "订单退款"),

    /**
     * 设计师邀请注册赠送抵用金
     */
    GIVE_BALANCE(19, "邀请注册赠送抵用金"),

    BOND_WITHDRAWAL(20, "保证金提现"),


    BOND_RECHARGE(21, "保证金充值"),
    ;

    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        return getWalletDetailEnums(code).name;
    }

    public static WalletDetailEnums getWalletDetailEnums(Integer code) {
        return Arrays.stream(WalletDetailEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    WalletDetailEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
