package com.fs.his.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum FsUserIntegralLogTypeEnum {
    TYPE_1(1,"签到获得积分"),
    TYPE_2(2,"消费获得积分"),
    TYPE_3(3,"分享获得积分"),
    TYPE_4(4,"退款扣除积分"),
    TYPE_5(5,"购买积分商品"),
    TYPE_6(6,"平台取消售后"),
    TYPE_7(7,"积分过期"),
    TYPE_8(8,"螳螂同步积分"),
    TYPE_9(9,"购买课程小节扣除"),
    TYPE_10(10,"观看课程获取积分"),
    TYPE_11(11,"新用户完善就诊人获得积分"),
    TYPE_12(12,"新用户填写收货地址获取积分"),
    TYPE_13(13,"浏览商品获得积分"),
    TYPE_14(14,"浏览视频获得积分"),
    TYPE_15(15,"首次下单疗法获得积分"),
    TYPE_16(16,"点播看课获得积分"),
    TYPE_17(17,"点播答题获得积分"),
    TYPE_18(18,"邀请新用户获取积分"),
    TYPE_19(19,"填写邀请码获取积分"),
    TYPE_20(20,"首次完成手机号绑定注册"),
    TYPE_21(21,"首次完成专家咨询"),
    TYPE_22(22,"首次完成积分商城下单"),
    TYPE_23(23,"管理员添加"),
    TYPE_24(24, "付费课程订阅"),
    TYPE_25(25, "直播完课积分"),
    TYPE_26(26, "直播红包积分"),
    TYPE_27(27, "积分订单取消退回积分"),
    TYPE_28(28, "首次登录 app 获得积分"),
    ;


    private Integer value;
    private String desc;

    public static FsUserIntegralLogTypeEnum toType(int value) {
        return Stream.of(FsUserIntegralLogTypeEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }
}
