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.MallBargain;

/**
 * 砍价活动业务对象 mall_bargain
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallBargain.class, reverseConvertGenerate = false)
public class MallBargainBo 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 bargainPrice;

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

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

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

    /**
     * 需要助力人数
     */
    @Min(value = 0, message = "需要助力人数不能为负数")
    private Integer helpCount;

    /**
     * 砍价有效期(小时)
     */
    @Min(value = 1, message = "砍价有效期必须大于0")
    private Integer durationHours;

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

}
