package com.ruoyi.enums;

import java.util.Arrays;

/**
 * 平台流水
 * @Author liwenlong
 */
public enum PlatformRecordEnums {


    PLAT_BASE(0, "资金原始金额"),
    ORDER_PAY(1, "订单首款支付"),

    ORDER_RETURN(2, "订单首款退款"),
    ORDER_SECOND_PAY(3, "订单尾款支付"),
    TEAM_COMMISSION(4, "推广员分佣"),
    STORE_ORDER_INCOME(5, "表现师收益扣除"),
    PLATFORM_AUTH_PAY(6, "表现师平台认证"),
    HEIGHT_AUTH_PAY(7, "表现师高端认证"),
    BOND_PAY(8, "保证金缴纳"),
    BOND_WITHDRAWAL(9, "保证金提现"),
    BOND_WITHDRAWAL_RETURN(10, "保证金提现返还"),
    RECHARGE_BALANCE(11, "设计师充值"),
    WITH_DEDU(12, "表现师提现"),
    WITH_FAIL_RETURN(13, "表现师提现返还"),
    VIOLATION_DEDUCTION(14, "表现师扣款"),
    VIOLATION_DEDUCTION_RETURN(15, "表现师扣款退回"),
    PLAT_ADD(16, "平台手动调整余额"),
    PLAT_SUB(17, "平台手动调整余额"),

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


    ;

    private final Integer code;
    private final String name;

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

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

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

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
