package com.ym.mec.biz.dal.entity;

import com.ym.mec.biz.dal.enums.CouponTypeEnum;
import com.ym.mec.biz.dal.enums.EffectiveTypeEnum;
import com.ym.mec.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 对应数据库表(sys_coupon):
 */
public class SysCoupon extends BaseEntity implements Serializable{

	private Integer id;

	@ApiModelProperty("优惠券名称")
	private String name;

	@ApiModelProperty("描述")
	private String description;

	@ApiModelProperty("状态：0停用，1启用")
	private Integer status;

    @NotNull(message = "请选择一个优惠券发放的类型！")
    @PositiveOrZero(message = "优惠券发放类型不正确！")
    @Max(value = 1,message = "优惠券发放类型不正确！")
    @ApiModelProperty(value = "0手动领取  1手动发放")
    private Integer issuanceType;

	@ApiModelProperty("券类型:FULL_REDUCTION(满减券)，DISCOUNT(折扣券)")
	private CouponTypeEnum type;

    @NotBlank(message = "优惠券详细分类不能为空!")
    @ApiModelProperty(value = "详情-CouponDetailTypeEnum-枚举类")
    private String typeDetail;

	@ApiModelProperty("面值")
	private java.math.BigDecimal faceValue;

	@ApiModelProperty("满多少")
	private java.math.BigDecimal fullAmount;

	@ApiModelProperty("限制兑换的最大次数")
	private Integer limitExchangeNum;

	@ApiModelProperty("期限（单位：天）")
	private Integer deadline;

	@ApiModelProperty("有效期类型")
	private EffectiveTypeEnum effectiveType;

	@ApiModelProperty("有效起始时间")
	private java.util.Date effectiveStartTime;

	@ApiModelProperty("有效截止时间")
	private java.util.Date effectiveExpireTime;

	@ApiModelProperty("领取结束时间")
	private java.util.Date endDate;

	@ApiModelProperty("领取开始时间")
	private java.util.Date startDate;

	@ApiModelProperty("库存量")
	private Integer stockCount;

	@ApiModelProperty("消耗数量")
	private Integer consumeNum;

	@ApiModelProperty("预警值")
	private Integer warningStockNum;

	private Integer warningStatus;

	private java.util.Date createTime;

	private java.util.Date updateTime;

	@ApiModelProperty("非数据库字段-可以领取的优惠券数量")
	private Integer canBeGetNum;

	@ApiModelProperty("领取优惠券条件JSON: {organId:分部id(逗号隔开)}")
	private String useCondition;

	public String getUseCondition() {
		return useCondition;
	}

	public void setUseCondition(String useCondition) {
		this.useCondition = useCondition;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public CouponTypeEnum getType() {
		return type;
	}

	public void setType(CouponTypeEnum type) {
		this.type = type;
	}

	public BigDecimal getFaceValue() {
		return faceValue;
	}

	public void setFaceValue(BigDecimal faceValue) {
		this.faceValue = faceValue;
	}

	public BigDecimal getFullAmount() {
		return fullAmount;
	}

	public void setFullAmount(BigDecimal fullAmount) {
		this.fullAmount = fullAmount;
	}

	public Integer getLimitExchangeNum() {
		return limitExchangeNum;
	}

	public void setLimitExchangeNum(Integer limitExchangeNum) {
		this.limitExchangeNum = limitExchangeNum;
	}

	public EffectiveTypeEnum getEffectiveType() {
		return effectiveType;
	}

	public void setEffectiveType(EffectiveTypeEnum effectiveType) {
		this.effectiveType = effectiveType;
	}

	public Integer getDeadline() {
		return deadline;
	}

	public void setDeadline(Integer deadline) {
		this.deadline = deadline;
	}

	public Date getEffectiveStartTime() {
		return effectiveStartTime;
	}

	public void setEffectiveStartTime(Date effectiveStartTime) {
		this.effectiveStartTime = effectiveStartTime;
	}

	public Date getEffectiveExpireTime() {
		return effectiveExpireTime;
	}

	public void setEffectiveExpireTime(Date effectiveExpireTime) {
		this.effectiveExpireTime = effectiveExpireTime;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Integer getStockCount() {
		return stockCount;
	}

	public void setStockCount(Integer stockCount) {
		this.stockCount = stockCount;
	}

	public Integer getConsumeNum() {
		return consumeNum;
	}

	public void setConsumeNum(Integer consumeNum) {
		this.consumeNum = consumeNum;
	}

	public Integer getWarningStockNum() {
		return warningStockNum;
	}

	public void setWarningStockNum(Integer warningStockNum) {
		this.warningStockNum = warningStockNum;
	}

	public Integer getWarningStatus() {
		return warningStatus;
	}

	public void setWarningStatus(Integer warningStatus) {
		this.warningStatus = warningStatus;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

    public Integer getIssuanceType() {
        return issuanceType;
    }

    public void setIssuanceType(Integer issuanceType) {
        this.issuanceType = issuanceType;
    }

    public String getTypeDetail() {
        return typeDetail;
    }

    public void setTypeDetail(String typeDetail) {
        this.typeDetail = typeDetail;
    }

    public Integer getCanBeGetNum() {
        return canBeGetNum;
    }

    public void setCanBeGetNum(Integer canBeGetNum) {
        this.canBeGetNum = canBeGetNum;
    }

    @Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}
