package com.lesingle.creation.dto.contest;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 创建竞赛 DTO
 */
@Data
@Schema(description = "创建竞赛请求")
public class CreateContestDTO {

    @NotBlank(message = "竞赛名称不能为空")
    @Schema(description = "竞赛名称", example = "第十届创意绘画比赛")
    private String contestName;

    @NotBlank(message = "竞赛类型不能为空")
    @Schema(description = "竞赛类型：individual-个人赛/team-团队赛", example = "individual")
    private String contestType;

    @Schema(description = "可见范围：public-公开/designated-指定机构/internal-仅内部", example = "designated")
    private String visibility;

    @Schema(description = "目标城市列表（定向推送时使用）")
    private List<String> targetCities;

    @Schema(description = "最小年龄限制", example = "6")
    private Integer ageMin;

    @Schema(description = "最大年龄限制", example = "18")
    private Integer ageMax;

    @NotNull(message = "竞赛开始时间不能为空")
    @Schema(description = "竞赛开始时间")
    private LocalDateTime startTime;

    @NotNull(message = "竞赛结束时间不能为空")
    @Schema(description = "竞赛结束时间")
    private LocalDateTime endTime;

    @Schema(description = "线下地址")
    private String address;

    @Schema(description = "竞赛详情")
    private String content;

    @Schema(description = "授权租户 ID 列表")
    private List<Integer> contestTenants;

    @Schema(description = "封面 URL")
    private String coverUrl;

    @Schema(description = "海报 URL")
    private String posterUrl;

    @Schema(description = "联系人")
    private String contactName;

    @Schema(description = "联系电话")
    private String contactPhone;

    @Schema(description = "联系人二维码")
    private String contactQrcode;

    @Schema(description = "主办单位")
    private String organizers;

    @Schema(description = "协办单位")
    private String coOrganizers;

    @Schema(description = "赞助单位")
    private String sponsors;

    @NotNull(message = "报名开始时间不能为空")
    @Schema(description = "报名开始时间")
    private LocalDateTime registerStartTime;

    @NotNull(message = "报名结束时间不能为空")
    @Schema(description = "报名结束时间")
    private LocalDateTime registerEndTime;

    @Schema(description = "报名任务状态：open-开放/closed-关闭", example = "open")
    private String registerState;

    @Schema(description = "是否需要审核", example = "true")
    private Boolean requireAudit;

    @Schema(description = "允许报名的年级 ID 列表")
    private List<Integer> allowedGrades;

    @Schema(description = "允许报名的班级 ID 列表")
    private List<Integer> allowedClasses;

    @Schema(description = "团队最少成员数", example = "1")
    private Integer teamMinMembers;

    @Schema(description = "团队最多成员数", example = "5")
    private Integer teamMaxMembers;

    @Schema(description = "提交规则：once-仅一次/resubmit-可重复提交", example = "once")
    private String submitRule;

    @NotNull(message = "作品提交开始时间不能为空")
    @Schema(description = "作品提交开始时间")
    private LocalDateTime submitStartTime;

    @NotNull(message = "作品提交结束时间不能为空")
    @Schema(description = "作品提交结束时间")
    private LocalDateTime submitEndTime;

    @Schema(description = "作品类型：image/video/document/code/other", example = "image")
    private String workType;

    @Schema(description = "作品要求说明")
    private String workRequirement;

    @Schema(description = "评审规则 ID")
    private Long reviewRuleId;

    @NotNull(message = "评审开始时间不能为空")
    @Schema(description = "评审开始时间")
    private LocalDateTime reviewStartTime;

    @NotNull(message = "评审结束时间不能为空")
    @Schema(description = "评审结束时间")
    private LocalDateTime reviewEndTime;

    @Schema(description = "结果发布时间")
    private LocalDateTime resultPublishTime;
}
