package com.yuchen.saas.parking.api.entity.coupon;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nest.springwrap.core.mp.base.BaseEntity;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author 蔡文强
 * @Date 2023/5/25 15:56
 * @Description 优惠活动
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("pmg_bat_coupon_activity")
@ApiModel(value="PmgBatCouponActivity对象", description="优惠活动表")
public class PmgBatCouponActivity extends BaseEntity {

    @ApiModelProperty(name = "grantId", value = "发放对象ID")
    @NotNull(message = "发放对象不能为空")
    private Long grantId;

    @ApiModelProperty(name = "grantName", value = "发放对象名称")
    @NotBlank(message = "发放对象不能为空")
    private String grantName;

    @ApiModelProperty(name = "couponActivityName", value = "优惠活动名称")
    @NotBlank(message = "优惠活动名称不能为空")
    private String couponActivityName;

    @ApiModelProperty(name = "couponActivityNo", value = "优惠活动编号")
    private String couponActivityNo;

    @ApiModelProperty(name = "activityType", value = "优惠活动类型(1:智慧停车 2:智慧充电 3:平台通用)")
    @NotNull(message = "优惠活动类型不能为空")
    @Min(value = 1, message = "activityType值要大于等于1")
    @Max(value = 3, message = "activityType值要小于等于3")
    private Integer activityType;

    @ApiModelProperty(name = "discountItems", value = "优惠适用费项(1:临停费用 2:月卡充值 3:错时充值 4:管理费 5:充电收费 6:停车占位收费),多选,逗号隔开")
    @NotBlank(message = "优惠适用费项不能为空")
    private String discountItems;

    @ApiModelProperty(name = "parkingIds", value = "适用范围(停车场ID,多个逗号隔开)")
    @NotBlank(message = "适用范围不能为空")
    private String parkingIds;

    @ApiModelProperty(name = "parkingNames", value = "适用范围(停车场名称,多个逗号隔开)")
    @NotBlank(message = "适用范围不能为空")
    private String parkingNames;

    @ApiModelProperty(name = "useType", value = "使用对象类型(1:用户领取 2:指定用户 3:指定车辆)")
    @NotNull(message = "使用对象类型不能为空")
    @Min(value = 1, message = "useType值要大于等于1")
    @Max(value = 3, message = "useType值要小于等于3")
    private Integer useType;

    @ApiModelProperty(name = "couponCount", value = "优惠券数量")
    private Integer couponCount;

    @ApiModelProperty(name = "limitCount", value = "每人限领")
    private Integer limitCount;

    @ApiModelProperty(name = "specifyUsers", value = "指定用户(多个用户,逗号隔开)")
    private String specifyUsers;
    @ApiModelProperty(name = "specifyVehicles", value = "指定车辆(多个车辆,逗号隔开)")
    private String specifyVehicles;

    @ApiModelProperty(name = "fundType", value = "优惠资金类型(1:虚拟额度 2:充值资金)")
    @NotNull(message = "优惠资金类型不能为空")
    @Min(value = 1, message = "fundType值要大于等于1")
    @Max(value = 2, message = "fundType值要小于等于2")
    private Integer fundType;
    @ApiModelProperty(name = "activityAmount", value = "活动总额度(单位分)")
    @NotNull(message = "活动总额度不能为空")
    private Integer activityAmount;


    @ApiModelProperty(name = "activityValidityType", value = "活动有效期类型(1:指定时间 2:无时间限制)")
    @NotNull(message = "活动有效期类型不能为空")
    @Min(value = 1, message = "activityValidityType值要大于等于1")
    @Max(value = 2, message = "activityValidityType值要小于等于2")
    private Integer activityValidityType;

    @ApiModelProperty(name = "startDate", value = "开始日期")
    private Date startDate;

    @ApiModelProperty(name = "endDate", value = "结束日期")
    private Date endDate;

    @ApiModelProperty(name = "remark", value = "备注信息")
    private String remark;

    @ApiModelProperty(name = "discountMode", value = "优惠方式(1:限免优惠 2:全免优惠)")
    @NotNull(message = "优惠方式不能为空")
    @Min(value = 1, message = "discountMode值要大于等于1")
    @Max(value = 2, message = "discountMode值要小于等于2")
    private Integer discountMode;

    @ApiModelProperty(name = "couponAmount", value = "优惠券金额(单位分)")
    @NotNull(message = "优惠券金额不能为空")
    @Min(value = 1, message = "couponAmount值要大于等于1")
    private Integer couponAmount;

    @ApiModelProperty(name = "suitCondition", value = "适用条件(1:满xx元可使用 2:无门槛使用(若优惠金额大于产品金额，则该产品价格为免费))")
    @NotNull(message = "适用条件不能为空")
    @Min(value = 1, message = "suitCondition值要大于等于1")
    @Max(value = 2, message = "suitCondition值要小于等于2")
    private Integer suitCondition;

    @ApiModelProperty(name = "conditionAmount", value = "满xx元可使用(单位分)")
    private Integer conditionAmount;


    @ApiModelProperty(name = "couponValidityType", value = "券有效期类型(1:领取后,第xx天内有效->提示:领取后,若优惠卡失效,优惠券未使用的话也同步失效 2:无时间限制)->使用对象类型为<用户领取>才有这个字段")
    private Integer couponValidityType;

    @ApiModelProperty(name = "days", value = "领取后，第xx天内有效->使用对象类型为<用户领取>才有这个字段")
    private Integer days;

    @ApiModelProperty(name = "instruction", value = "券适用说明")
    @NotBlank(message = "券适用说明不能为空")
    private String instruction;

    @ApiModelProperty(name = "codeType", value = "优惠活动二维码类型(1:动态二维码 2:静态二维码)")
    private Integer codeType;

    @ApiModelProperty(name = "qrCode", value = "优惠活动二维码")
    private String qrCode;

    @ApiModelProperty(name = "activityStatus", value = "优惠活动状态(1:未生效 2:生效中 3:已过期)")
    private Integer activityStatus;

}
