package com.lesingle.creation.vo.review;

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

import java.util.List;

/**
 * 评审进度统计 VO
 */
@Data
@Schema(description = "评审进度统计")
public class ReviewProgressVO {

    @Schema(description = "活动信息")
    private ContestInfo contest;

    @Schema(description = "评审摘要统计")
    private ReviewSummary summary;

    @Schema(description = "进度百分比")
    private Progress progress;

    @Schema(description = "评委进度列表")
    private List<JudgeProgressItem> judgeProgress;

    @Schema(description = "待分配作品列表")
    private List<UnassignedWork> unassignedWorks;

    @Schema(description = "待评审分配列表")
    private List<PendingAssignment> pendingAssignments;

    @Data
    @Schema(description = "活动信息")
    public static class ContestInfo {
        @Schema(description = "活动 ID")
        private Long id;
        @Schema(description = "活动名称")
        private String contestName;
        @Schema(description = "评审开始时间")
        private java.time.LocalDateTime reviewStartTime;
        @Schema(description = "评审结束时间")
        private java.time.LocalDateTime reviewEndTime;
    }

    @Data
    @Schema(description = "评审摘要统计")
    public static class ReviewSummary {
        @Schema(description = "总作品数")
        private int totalWorks;
        @Schema(description = "已分配作品数")
        private int assignedWorksCount;
        @Schema(description = "已评分作品数")
        private int scoredWorksCount;
        @Schema(description = "未分配作品数")
        private int unassignedWorksCount;
        @Schema(description = "评委总数")
        private int totalJudges;
        @Schema(description = "总分配数")
        private int totalAssignments;
        @Schema(description = "总评分数")
        private int totalScores;
        @Schema(description = "待评分数")
        private int pendingScoresCount;
    }

    @Data
    @Schema(description = "进度百分比")
    public static class Progress {
        @Schema(description = "分配进度百分比")
        private double assignmentProgress;
        @Schema(description = "评分进度百分比")
        private double scoringProgress;
        @Schema(description = "总体进度百分比")
        private double overallProgress;
    }

    @Data
    @Schema(description = "评委进度项")
    public static class JudgeProgressItem {
        @Schema(description = "评委 ID")
        private Long judgeId;
        @Schema(description = "评委姓名")
        private String judgeName;
        @Schema(description = "专业")
        private String specialty;
        @Schema(description = "权重")
        private Double weight;
        @Schema(description = "已分配数")
        private int assignedCount;
        @Schema(description = "已评分数")
        private int scoredCount;
        @Schema(description = "待评分数")
        private int pendingCount;
        @Schema(description = "进度百分比")
        private double progress;
    }

    @Data
    @Schema(description = "待分配作品")
    public static class UnassignedWork {
        @Schema(description = "作品 ID")
        private Long id;
        @Schema(description = "作品编号")
        private String workNo;
        @Schema(description = "作品标题")
        private String title;
        @Schema(description = "创建时间")
        private java.time.LocalDateTime createTime;
        @Schema(description = "参赛者信息")
        private ParticipantInfo registration;
    }

    @Data
    @Schema(description = "参赛者信息")
    public static class ParticipantInfo {
        @Schema(description = "用户 ID")
        private Long id;
        @Schema(description = "用户名")
        private String username;
        @Schema(description = "昵称")
        private String nickname;
        @Schema(description = "团队 ID")
        private Long teamId;
        @Schema(description = "团队名称")
        private String teamName;
    }

    @Data
    @Schema(description = "待评审分配")
    public static class PendingAssignment {
        @Schema(description = "分配 ID")
        private Long id;
        @Schema(description = "作品 ID")
        private Long workId;
        @Schema(description = "作品编号")
        private String workNo;
        @Schema(description = "作品标题")
        private String workTitle;
        @Schema(description = "评委 ID")
        private Long judgeId;
        @Schema(description = "评委姓名")
        private String judgeName;
        @Schema(description = "分配状态")
        private String status;
        @Schema(description = "分配时间")
        private java.time.LocalDateTime assignmentTime;
    }
}
