1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.talentcard.server.request;
 
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
 
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
 
@Schema(name = "CouponManagementSaveRequest", description = "优惠券配置保存参数")
public record CouponManagementSaveRequest(
        @NotNull @Schema(description = "适用商户ID", example = "1") Long merchantId,
        @NotBlank @Size(max = 128) @Schema(description = "优惠券名称") String couponName,
        @NotBlank @Schema(description = "类型:CASH代金券、FULL_REDUCTION满减券、DISCOUNT折扣券、EXCHANGE兑换券") String couponType,
        @NotNull @DecimalMin("0.00") @Schema(description = "面额,单位元", example = "50.00") BigDecimal couponAmount,
        @Schema(description = "使用条件:NONE无门槛、FULL满减") String conditionType,
        @DecimalMin("0.00") @Schema(description = "满减门槛金额") BigDecimal conditionAmount,
        @Schema(description = "适用人才卡等级") List<String> talentLevels,
        @Schema(description = "有效开始日期") LocalDate validStart,
        @Schema(description = "有效结束日期") LocalDate validEnd,
        @Size(max = 64) @Schema(description = "发放批次号,不传自动生成") String batchNo,
        @NotNull @Min(-1) @Schema(description = "发放总量,-1表示不限量", example = "1000") Integer totalQuantity,
        @Schema(description = "是否政府补贴") Boolean governmentSubsidy,
        @Schema(description = "状态:0下架、1上架", example = "1") Integer status
) {}