package com.cyksj.model.entity;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Arrays;

/*
 *项目名: netflix
 *文件名: DistributeMoneyApply
 *创建者: JavaZou
 *创建时间:2022/11/14 14:00
 */
@Getter
@Setter
public class DistributeMoneyApply extends BaseEntity {

	private Long userId;

	private BigDecimal money;

	private String reason;

	private BigDecimal points;

	private Status verifyStatus;

	/**
	 * 功能类型
	 */
	private MType mType;

	private Type type;

	/**
	 * usdt网格
	 */
	private String network;

	private String account;

	private String realName;

	private String img;

	/**
	 * 钱包地址
	 */
	private String walletAddr;

	/**
	 * 备注
	 */
	private String remark;

	private Long businessId;

	private String businessName;

	@Getter
	public enum Type {
		zfb("支付宝"),
		wechat("微信"),
		usdt("usdt"),
		pwdRed("口令红包"),
		other("其他")
		;
		String desc;

		Type(String desc) {
			this.desc = desc;
		}

		public Type getType(String value) {
			if (StrUtil.isEmpty(value)) {
				return null;
			}
			return Arrays.stream(Type.values()).filter(type -> type.name().equals(value)).findFirst().get();
		}

	}

	@Getter
	public enum Status {
		success("审核成功"),
		fail("审核失败"),
		verifying("审核中"),
		;
		String desc;

		Status(String desc) {
			this.desc = desc;
		}

		public static Status checkStatus(String status) {
			return Arrays.stream(Status.values()).filter(st -> st.name().equals(status)).findFirst().orElse(null);
		}
	}

	@Getter
	public enum MType {
		ds("用户分销"),
		sub("邀请奖励"),
		;
		String desc;

		MType(String desc) {
			this.desc = desc;
		}

		public MType getType(String value) {
			if (StrUtil.isEmpty(value)) {
				return null;
			}
			return Arrays.stream(MType.values()).filter(type -> type.name().equals(value)).findFirst().get();
		}
	}
}
