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

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

import java.io.Serial;
import java.io.Serializable;

/**
 * 项目添加请求体
 */
@Data
@Schema(description = "项目添加请求体", requiredProperties = {
                "projectName",
                "projectImage",
                "projectSettlementCycle",
                "maxPromoterCount",
                "projectStatus",
                "projectDescription",
                "settlementDesc",
                "projectDesc",
                "projectFlow",
                "applyPromoCodeDesc",
})
public class ProjectAddRequest implements Serializable {

    /**
     * 项目名称
     */
    @NotBlank(message = "项目名称不能为空")
    @Schema(description = "项目名称", example = "美团省钱包")
    private String projectName;

    /**
     * 项目图片URL
     */
    @NotBlank(message = "项目图片URL不能为空")
    @Schema(description = "项目图片URL", example = "3E8U2AM8")
    private String projectImage;

    /**
     * 项目结算周期
     */
    @Min(value = 1, message = "项目结算周期不能小于1")
    @Schema(description = "项目结算周期", example = "2")
    private Integer projectSettlementCycle;

    /**
     * 最大推广人数
     */
    @Min(value = 1, message = "最大推广人数不能小于1")
    @Schema(description = "最大推广人数", example = "200")
    private Integer maxPromoterCount;

    /**
     * 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
     */
    @NotBlank(message = "项目状态不能为空")
    @EnumValue(enumClass = ProjectStatusEnum.class)
    @Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
    private String projectStatus;

    /**
     * 项目简介
     */
    @NotBlank(message = "项目简介不能为空")
    @Schema(description = "项目简介", example = "不限制推广方式，禁止/恶意/夸大虚假宣传")
    private String projectDescription;

    /**
     * 结算说明（富文本）
     */
    @NotBlank(message = "结算说明（富文本）不能为空")
    @Schema(description = "结算说明（富文本）", example = "富文本")
    private String settlementDesc;

    /**
     * 项目说明（富文本）
     */
    @NotBlank(message = "项目说明（富文本）不能为空")
    @Schema(description = "项目说明（富文本）", example = "富文本")
    private String projectDesc;

    /**
     * 项目流程（富文本）
     */
    @NotBlank(message = "项目流程（富文本）不能为空")
    @Schema(description = "项目流程（富文本）", example = "富文本")
    private String projectFlow;

    /**
     * 申请推广码说明（富文本）
     */
    @NotBlank(message = "申请推广码说明（富文本）不能为空")
    @Schema(description = "申请推广码说明（富文本）", example = "富文本")
    private String applyPromoCodeDesc;


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

