package com.snack.server.module.seckill.dto.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 添加活动商品请求
 */
@Data
@Schema(description = "添加抢购活动商品")
public class SeckillProductAddReq implements Serializable {

    @NotNull(message = "活动 ID 不能为空")
    @Schema(description = "活动 ID")
    private Long activityId;

    @NotNull(message = "商品 SKU ID 不能为空")
    @Schema(description = "商品 SKU ID")
    private Long skuId;

    @NotNull(message = "抢购价不能为空")
    @DecimalMin(value = "0.01", message = "抢购价必须大于 0")
    @Schema(description = "抢购价")
    private BigDecimal seckillPrice;

    @NotNull(message = "库存不能为空")
    @Min(value = 1, message = "库存至少为 1")
    @Schema(description = "抢购总库存")
    private Integer seckillStock;

    @Min(value = 1, message = "每人限购至少 1")
    @Schema(description = "每人限购数量", example = "1")
    private Integer perLimit = 1;

    @Schema(description = "活动内排序")
    private Integer sort = 0;
}
