
package com.tmerclub.cloud.discount.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 满减满折优惠DTO
 *
 * @author lhd
 * @date 2020-12-10 13:43:38
 */
@Data
@ToString
public class DiscountDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "满减满折优惠id")
    private Long discountId;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "店铺名称")
    private String shopName;

    @Schema(description = "活动名称")
    @NotNull(message = "活动名称不能为空")
    private String discountName;

    @Schema(description = "枚举DiscountRule(0 满钱减钱 3满件打折)")
    private Integer discountRule;

    @Schema(description = "减免类型 0按满足最高层级减一次 1每满一次减一次")
    private Integer discountType;

    @Schema(description = "适用商品类型 0全部商品参与 1指定商品参与")
    @Max(value = 1, message = "适用商品类型错误")
    @Min(value = 0, message = "适用商品类型错误")
    private Integer suitableSpuType;

    @Max(999999999)
    @Schema(description = "最多减多少")
    private Long maxReduceAmount;

    @Schema(description = "开始时间")
    private Date startTime;

    @Schema(description = "结束时间")
    private Date endTime;

    @Schema(description = "活动状态:(0:关闭、1:开启、2:违规下线、3:平台审核)")
    @Min(value = 0, message = "活动添加或改变后的状态异常")
    @Max(value = 3, message = "活动添加或改变后的状态异常")
    private Integer status;

    @Schema(description = "手机端活动图片")
    private String mobilePic;

    @Schema(description = "pc端活动列表图片")
    private String pcPic;

    @Schema(description = "pc端活动背景图片")
    private String pcBackgroundPic;

    @Schema(description = "商品Id列表")
    private List<Long> spuIds;

    @Schema(description = "活动项")
    private List<DiscountItemDTO> discountItemList;

    private List<Long> shopIds;


}
