package com.greenorange.promotion.model.dto.userPerformanceSummary;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 抽成比例更新请求体
 */
@Data
@Schema(description = "抽成比例更新请求体", requiredProperties = {"level", "rate"})
public class RakeRewardsUpdateRequest implements Serializable {

    /**
     * 级别
     */
    @NotBlank(message = "级别不能为空")
    @Pattern(regexp = "first|second", message = "级别只能是first或second")
    @Schema(description = "级别", example = "first")
    private String level;


    /**
     * 抽成比例
     */
    @DecimalMin(value = "0.0", message = "抽成比例不能小于0.0")
    @DecimalMax(value = "1.0", message = "抽成比例不能大于1.0")
    @Schema(description = "抽成比例", example = "0.1")
    private BigDecimal rate;


    @Serial
    private static final long serialVersionUID = 1L;

}
