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

/**
 * 拼团活动业务对象 mall_group_buy
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallGroupBuy.class, reverseConvertGenerate = false)
public class MallGroupBuyBo 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 groupPrice;

    /**
     * 成团人数
     */
    @NotNull(message = "成团人数不能为空", groups = {AddGroup.class, EditGroup.class})
    @Min(value = 2, message = "成团人数至少为2人")
    private Integer groupSize;

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

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

}
