package com.crm.rely.backend.core.entity.market.promo.code;

import com.crm.rely.backend.core.constant.Constants;
import com.crm.rely.backend.core.entity.base.BaseAddEntity;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author: houn
 * @Date: 2020/12/14 16:58
 * @Description:
 */
@Data
public class MarketPromoCodeAddEntity extends BaseAddEntity {

    private String promoCode;

    /**
     * 优惠类型 1百分比 2固定金额
     */
    @NotNull(message = Constants.PARAMETER_ERROR)
    private Integer promoType;

    /**
     * 金额比例
     */
    private Float amountProportion;

    /**
     * 优惠上限 promo_type=1时  根据amount_proportion计算出来的赠送金额最高是这个值 如果为0无上限
     */
    private BigDecimal amountToplimit;

    /**
     * 固定金额
     */
    private BigDecimal amountFixed;

    @NotNull(message = Constants.PARAMETER_ERROR)
    private Integer giveType;

    private Integer creditLoss;

    @NotNull(message = Constants.PARAMETER_ERROR)
    @NotBlank(message = Constants.PARAMETER_ERROR)
    private String giveCurrency;

    /**
     * 是否绑定邮箱 0不是 1是
     */
    @NotNull(message = Constants.PARAMETER_ERROR)
    private Integer bindEmail;

    private String email;

    /**
     * 有效时间 单位天
     */
    @NotNull(message = Constants.PARAMETER_ERROR)
    private Integer expire;

    private Date expireTime;

    private List<String> closeFunctions;
}
