package com.czg.market.dto;

import com.czg.validator.group.UpdateGroup;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Administrator
 */
@Data
public class MkRedemptionConfigDTO implements Serializable {


    @NotNull(message = "id不能为空", groups = UpdateGroup.class)
    private Long id;

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 赠送金额
     */
    @DecimalMin(value = "0.01", message = "赠送金额不能小于0.01")
    private BigDecimal amount;

    /**
     * 券信息
     */
    @Valid
    private List<CouponInfoDTO> couponInfoList;

    /**
     * 库存
     */
    private Integer stock;

    /**
     * 总数
     */
    @Min(value = 0, message = "总数不能小于0")
    @NotNull(message = "总数不能为空")
    @Max(value = 1000, message = "总数不能大于1000")
    private Integer total;

    /**
     * 可用开始时间
     */
    private LocalDateTime startTime;

    /**
     * 可用结束时间
     */
    private LocalDateTime endTime;
}

