package com.wzj.soopin.order.domain.query;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import java.math.BigDecimal;

/**
 * 发红包请求参数
 */
@Data
@Schema(description = "发红包请求参数")
public class SendRedPacketRequest {

    @NotNull(message = "聊天类型不能为空")
    @Range(min = 1, max = 2, message = "聊天类型只能是1(单聊)或2(群聊)")
    @Schema(description = "聊天类型(1:单聊 2:群聊)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer chatType;

    @NotNull(message = "发送者ID不能为空")
    @Schema(description = "发送者ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long senderId;

    @Schema(description = "接收者ID(单聊时必填)")
    private Long receiverId;

    @Schema(description = "群id(群聊时必填)")
    private Long groupId;

    @NotNull(message = "红包类型不能为空")
    @Range(min = 1, max = 2, message = "红包类型只能是1(普通)或2(拼手气)")
    @Schema(description = "红包类型(1:普通 2:拼手气)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer packetType;

    @NotNull(message = "总金额不能为空")
    @DecimalMin(value = "0.01", message = "总金额不能小于0.01")
    @Schema(description = "总金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private BigDecimal totalAmount;

    @NotNull(message = "总个数不能为空")
    @Min(value = 1, message = "总个数不能小于1")
    @Schema(description = "总个数", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer totalCount;


    @Schema(description = "备注(祝福语)")
    private String remark;
}
