package com.sonic.lion.lib.input;

import com.sonic.lion.lib.enums.BizType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.time.LocalDateTime;

@Data
public class PlatformGiftInput {
    private String outTradeNo;
    private String platform;
    private String extend;
    private Long uid;
    private String name;
    private LocalDateTime createTime;
    private Long amount; //赠送金额
    private Type type;

    private String ip;
    private String reason;


    @AllArgsConstructor
    @Getter
    public enum Type {

        NEW_USER_GIFT(BizType.NEW_USER_GIFT, false, BuffType.BALANCE),               //新手礼
        VIP_BUFF_GIFT(BizType.VIP_BUFF_GIFT, false, BuffType.BALANCE),              //订阅VIP 赠送BUFF
        SIGN_IN_GIFT(BizType.SIGN_IN_GIFT, false, BuffType.BALANCE),              //签到 赠送BUFF
        ;
        private BizType bizType; //业务类型
        private boolean needConfirm; //是否需要确认。
        private BuffType buffType;
    }


    @Getter
    public enum BuffType {
        /**
         * 可消费Buff
         */
        BALANCE(1, "BALANCE"),
        /**
         * 可提现收入
         */
        WITHDRAWABLE_INCOME(2, "WITHDRAWABLE_INCOME"),
        /**
         * 待入账收入
         */
        AWAITING_INCOME(3, "AWAITING_INCOME"),
        /**
         * 冻结收入
         */
        FROZEN_INCOME(4, "FROZEN_INCOME"),
        FROZEN_BALANCE(5, "FROZEN_BALANCE"),
        ;

        private final int value;
        private final String desc;

        BuffType(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }

}