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

import com.greenorange.promotion.annotation.EnumValue;
import com.greenorange.promotion.model.enums.CommissionStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Min;
import lombok.Data;
import java.math.BigDecimal;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 课程推广待提成记录添加请求体
 */
@Data
@Schema(description = "课程推广待提成记录添加请求体", requiredProperties = {
                "firstUserId",
                "secondUserId",
                "courseId",
                "name",
                "type",
                "image",
                "orderId",
                "userId",
                "totalAmount",
                "commissionStatus",
                "orderCreateTime",
})
public class CoursePromotionCommissionPendingAddRequest implements Serializable {

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

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

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

    /**
     * 课程名称
     */
    @NotBlank(message = "课程名称不能为空")
    @Schema(description = "课程名称", example = "财务管理")
    private String name;

    /**
     * 课程类别
     */
    @NotBlank(message = "课程类别不能为空")
    @Schema(description = "课程类别", example = "财经")
    private String type;

    /**
     * 课程图片
     */
    @NotBlank(message = "课程图片不能为空")
    @Schema(description = "课程图片", example = "3JD32NDS")
    private String image;

    /**
     * 课程订单id
     */
    @Min(value = 1L, message = "课程订单id ID不能小于1")
    @Schema(description = "课程订单id", example = "1")
    private Long orderId;

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

    /**
     * 订单价格
     */
    @Schema(description = "订单价格", example = "50.00")
    private BigDecimal totalAmount;

    /**
     * 提成状态
     */
    @NotBlank(message = "提成状态不能为空")
    @EnumValue(enumClass = CommissionStatusEnum.class)
    @Schema(description = "提成状态", example = "待提成")
    private String commissionStatus;

    /**
     * 订单创建时间
     */
    @Schema(description = "订单创建时间", example = "2025-05-02 12:23:00")
    private LocalDate orderCreateTime;


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

