package com.ruoyi.enums.order;

import java.util.Arrays;

/**
 * 订单支付金额流水枚举
 * @Author liwenlong
 */
public enum OrderPriceEnums {

    first_pay(1, "定金支付"),
    second_pay(2, "尾款支付"),
    appeal_add(3, "申诉加款"),
    appeal_sub(4, "申诉扣款"),
    change(5, "调价"),


    ;

    private final Integer code;
    private final String name;

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


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

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

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
