
package com.tmerclub.cloud.product.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

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

/**
 * 赠品表DTO
 *
 * @author tmerclub
 * @date 2022-08-16 11:11:58
 */
@Data
@ToString
public class GiveawayDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "赠品id")
    private Long giveawayId;

    @Schema(description = "赠品名称")
    @Length(max = 20, message = "赠品名称长度不能超过20")
    private String name;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

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

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

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

    @Schema(description = "主商品id")
    private Long spuId;

    @Schema(description = "商品价格")
    private Double price;

    @Schema(description = "主商品图片")
    private String mainImgUrl;

    @Schema(description = "主商品名称")
    private String spuName;

    @Schema(description = "主商品名称")
    private String giveawaySpuName;

    @Schema(description = "购买数量（购买了多少件才赠送赠品）")
    private Integer buyNum;

    @Schema(description = "状态 -1：已删除 0：关闭 1:开启")
    private Integer status;

    @Schema(description = "赠送商品列表")
    @Valid
    private List<GiveawaySpuDTO> giveawaySpus;

}
