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

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

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

/**
 * 用户主要信息添加请求体
 */
@Data
@Schema(description = "用户主要信息添加请求体", requiredProperties = {
                "teamSize",
                "teamEarnings",
                "parentEarnings",
                "currentBalance",
                "withdrawalAmount",
                "withdrawnAmount",
                "totalIncome",
                "uniteRate",
                "userId",
                "inviteQrCode",
})
public class UserMainInfoAddRequest implements Serializable {

    /**
     * 团队人数（不包括自己）
     */
    @Schema(description = "团队人数（不包括自己）", example = "10")
    private Integer teamSize;

    /**
     * 团队收益
     */
    @Schema(description = "团队收益", example = "40.00")
    private BigDecimal teamEarnings;

    /**
     * 给上级带来的收益
     */
    @Schema(description = "给上级带来的收益", example = "1.00")
    private BigDecimal parentEarnings;

    /**
     * 当前余额
     */
    @Schema(description = "当前余额", example = "45.00")
    private BigDecimal currentBalance;

    /**
     * 提现中的金额
     */
    @Schema(description = "提现中的金额", example = "20.00")
    private BigDecimal withdrawalAmount;

    /**
     * 已提现的金额
     */
    @Schema(description = "已提现的金额", example = "25.00")
    private BigDecimal withdrawnAmount;

    /**
     * 累计收入
     */
    @Schema(description = "累计收入", example = "70.00")
    private BigDecimal totalIncome;

    /**
     * 统一抽佣比例
     */
    @Schema(description = "统一抽佣比例", example = "5")
    private BigDecimal uniteRate;

    /**
     * 用户id
     */
    @Min(value = 1L, message = "用户id ID不能小于1")
    @Schema(description = "用户id", example = "1")
    private Long userId;

    /**
     * 邀请二维码
     */
    @NotBlank(message = "邀请二维码不能为空")
    @Schema(description = "邀请二维码", example = "3E8U2AM8")
    private String inviteQrCode;


    @Serial
    private static final long serialVersionUID = 1L;
}

