package cn.newfeifan.mall.module.distri.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum IntegralEnum {
    PT_TOP_TUP(1,"平台充值"),
    RED_INTEGRAL_TRANSITION_GREEN_INTEGRAL(2,"红积分转换成绿积分"),
    YELLOW_INTEGRAL_TRANSITION_RED_INTEGRAL(3,"黄积分转换成红积分"),
    INTEGRAL_TRANSFER(4,"积分转出"),
    INTEGRAL_RECIPIENT(5,"积分转入"),
    COMMISSION_WITHDRAWAL(5,"积分提现"),
    PAY_ORDER(6,"购物支付"),
    REFUND_ORDER(7,"退回退款返回"),
    TOP_UP_GET(8,"充值获得"),
    CANCEL_ORDER_BACK_CONSUMPTION_POINTS(9,"手动取消订单退回消费分"),
    ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL(10,"支付超时退回消费分"),
    RECOMMENDED_PERSON_QUOTA(11, "直推奖获得"),           //直推奖获得可用积分
    ORDER_CANCEL_BY_USER_REFUND_INTEGRAL(12,"手动取消支付返回"),
    BUY_ORDER(13,"用户下单"),
    ORDER_SETTLEMENT(14,"订单结算"),
    TEAM_BONUS(15,"团队奖"),
    LUCKY_BONUS(16,"幸运奖"),
    ;

    private final Integer type;
    private final String name;

    public static String getName(Integer type){
        for (IntegralEnum value : IntegralEnum.values()) {
            if(value.getType().equals(type)){
                return value.getName();
            }
        }
        return null;
    }
}
