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

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CaclEnum {
    PLATFORM_TOTAL_ADD(0, "平台总收益","平台总收益"),
    PLATFORM_SERVICE_FEE(1, "平台服务费","平台服务费"),
    PLATFORM_REVENUE(2, "平台收益","平台收益"),
    RECOMMENDED_PERSON_QUOTA(3, "直推奖获得","直推奖获得"),           //直推奖获得可用积分
    DIRECT_REFERRAL_QUOTA(4, "购物获得","购物获得可用积分"),       //购物用户自得额度
    TOGETHER_AWARD(5, "合赢奖","合赢奖"),
    HIGH_QUOTA(6, "最高可以获得积分","最高可以获得积分"),
    SMALL_QUOTA_CRASH(7, "合赢奖获得","小区额度分配"),
    AFTER_CRASH_CALC_PT_TOTAL_QUOTA(8, "碰撞后计算平台总收益","碰撞后计算平台总收益"),
    ORDER_PAY_INTEGRAL(9, "购物支付","购物使用积分进行支付"),      //购物使用积分进行支付
    ORDER_REFUND_INTEGRAL(10, "退回退款返回","退回退款订单项,消费者支付的积分"),
    AFTER_CRASH_CALC_PT_TOTAL_GROSS_QUOTA(12, "碰撞后计算平台收益","碰撞后计算平台收益"),
    GROSS_PROFIT_BONUS_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT(14, "合赢奖超额","合赢奖超额"),
    GROSS_PROFIT_ANCESTOR_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT(15, "直推奖超额","直推奖超额"),
    ORDER_CANCEL_BY_USER_REFUND_INTEGRAL(16,"手动取消支付返回","取消订单，退回积分"),
    ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL(17,"支付超时返回","订单超时未支付，退回积分"),
    ORDER_PAY_INTEGRAL_ANCESTER(18, "直推奖获得","直推人购物,推荐人获得冻结积分"),//购物 上级直推人 获得积分
    ORDER_REFUND_INTEGRAL_CONSUMER(19,"订单退款-撤回购物获得","订单退款，收回消费者获得的冻结积分"),
    ORDER_REFUND_INTEGRAL_ANCESTER(20,"订单退款-撤回直推奖","订单退款，收回消费者的推荐人，获得的冻结积分"),
    ORDER_PAY_INTEGRAL_CONSUMER(21, "购物获得","消费者购物,获得冻结积分"),//购物者本人 获得积分
    SMALL_QUOTA_CRASH_SETTLE(22, "合赢奖结算获得","每天计算的合赢奖7天后结算"),
    ORDER_PAY_FREEZE_HIGH_QUOTA(23, "购物获得","消费者购物,获得冻结峰值"),
    ORDER_REFUND_ORDER_PAY_FREEZE_HIGH_QUOTA(24, "订单退款-撤回峰值奖","消费者购物,获得冻结峰值"),
    MANUAL_RETURN_INTEGRAL(25, "人工返回最早七天未获得的超出额度的合赢奖","人工返回最早七天未获得的合赢奖,超额的"),
    WITHDRAWAL(26, "用户提现","用户将可用积分提现到账户"),
    WITHDRAWAL_ERROR(27, "提现失败退回","提现失败退回积分到用户"),
    ;

    /**
     * 来源
     */
    private final Integer type;
    /**
     * 类型的名字
     */
    private final String name;

    /**
     * 描述
     */
    private final String mark;

    public static CaclEnum getCaclEnumByValue(int value) {
        for (CaclEnum caclEnum : CaclEnum.values()) {
            if (caclEnum.getType() == value) {
                return caclEnum;
            }
        }
        return null;
    }

}