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

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
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.MallPromotion;

import java.util.Date;

/**
 * 营销活动业务对象 mall_promotion
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallPromotion.class, reverseConvertGenerate = false)
public class MallPromotionBo extends BaseEntity {

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

    /**
     * 活动名称
     */
    @NotBlank(message = "活动名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 128, message = "活动名称长度不能超过128个字符")
    private String name;

    /**
     * 活动类型(0普通活动 1拼团 2秒杀 3砍价)
     */
    @NotNull(message = "活动类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer type;

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

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

    /**
     * 活动规则(JSON)
     */
    private String rules;

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

    /**
     * 备注
     */
    @Size(max = 512, message = "备注长度不能超过512个字符")
    private String remark;

}
