package org.dromara.mall.promotion.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.mall.promotion.domain.MallSeckill;

import java.util.Date;

/**
 * 秒杀活动业务对象 mall_seckill
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallSeckill.class, reverseConvertGenerate = false)
public class MallSeckillBo extends BaseEntity {

    /**
     * 秒杀ID
     */
    @NotNull(message = "秒杀ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 活动ID
     */
    @NotNull(message = "活动ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long promotionId;

    /**
     * SKU ID
     */
    @NotNull(message = "SKU ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long skuId;

    /**
     * 秒杀价(分)
     */
    @NotNull(message = "秒杀价不能为空", groups = {AddGroup.class, EditGroup.class})
    @Min(value = 1, message = "秒杀价必须大于0")
    private Integer seckillPrice;

    /**
     * 秒杀库存
     */
    @NotNull(message = "秒杀库存不能为空", groups = {AddGroup.class, EditGroup.class})
    @Min(value = 1, message = "秒杀库存必须大于0")
    private Integer seckillStock;

    /**
     * 开始时间
     */
    @NotNull(message = "开始时间不能为空", groups = {AddGroup.class, EditGroup.class})
    private Date startTime;

    /**
     * 结束时间
     */
    @NotNull(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
    private Date endTime;

    /**
     * 状态(0启用 1禁用)
     */
    private Integer status;

}
