package com.cyksj.model.entity;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/*
 *项目名: netflix
 *文件名: LuckyDraw
 *创建者: JavaZou
 *创建时间:2022/12/27 15:57
 */
@Getter
@Setter
public class LuckyDraw extends BaseEntity {
	@NotNull(message = "类型不能为空")
	private Type type;

	@NotEmpty(message = "奖品名称不能为空")
	private String name;

	private Integer points;

	private Long couponId;

	private Long goodsId;

	private Long skuId;

	private Integer days;

	private Integer cost;

	private Integer num;

	@NotEmpty(message = "奖品位置不能为空")
	private String position;

	@NotNull(message = "概率不能为空")
	private BigDecimal probability;

	private String picture;

	private LuckyDraw.DrawType drawType;

	private Boolean status;

	private Boolean deleted;

	@Getter
	public enum Type {
		points("积分"),
		coupon("优惠券"),
		realGoods("实物"),
		virtualGoods("虚物"),
		duration("车票时长"),
		;
		String desc;

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

	@Getter
	public enum DrawType {
		normal("普通奖池"),
		specific("特定奖池"),
		;
		String desc;

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