package com.cyksj.model.entity;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/*
 *项目名: netflix
 *文件名: CouponUser
 *创建者: JavaZou
 *创建时间:2022/11/18 11:43
 */
@Getter
@Setter
public class CouponUser extends BaseEntity {
	private Long userId;

	/**
	 * 优惠券id
	 */
	private Long couponId;

	/**
	 * 发放id
	 */
	private Long couponActiveId;

	/**
	 * 推荐id
	 */
	private Long recommendId;

	/**
	 * 关联推广id
	 */
	private Long popularizeId;

	/**
	 * 获取渠道
	 */
	private Channel channel;

	/**
	 * 折扣卷折扣 用于分销
	 */
	private BigDecimal discount;

	/**
	 * 优惠券使用状态
	 */
	private Status status;

	private Date validStartTime;

	private Date validEndTime;

	@Getter
	public enum Channel {
		recommend("recommend", "推荐渠道"),
		center("unused", "领卷中心"),
		exCode("exCode", "兑换码"),
		wxCorp("wxCorp", "企业微信"),
		manual("manual", "手动发放"),
		lottery("lottery", "抽奖"),
		task("task", "完成任务"),
		equipment("equipment", "实物设备分销"),
		ques_response("ques_response", "问卷回答"),
		corp_bulk_task("corp_bulk_task", "企业微信群发任务"),
		channel_popularize("channel_popularize", "渠道推广"),
		new_welfare("new_welfare", "新人福利"),
		corp_active_code("corp_active_code", "企业微信活码"),
		customer_link("customer_link", "获客链接"),
		student_cert("student_cert","大学生认证"),
		yl("yl", "企业微信引流"),
		ptfq("ptfq","平台发券")
		;
		private String channel;
		private String desc;

		Channel(String channel, String desc) {
			this.channel = channel;
			this.desc = desc;
		}
	}

	@Getter
	public enum Status {
		used("used", "已使用"),
		unused("unused", "未使用"),
		expired("expired", "已过期"),
		invalid("invalid", "已失效"),
		notEffective("notEffective", "未生效"),
		;
		private String status;
		private String desc;

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