package com.lesingle.edu.dto.response;

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

import java.time.LocalDateTime;
import java.util.List;

/**
 * 任务完成详情响应
 */
@Data
@Builder
@Schema(description = "任务完成详情响应")
public class TaskCompletionDetailResponse {

    @Schema(description = "完成记录ID")
    private Long id;

    @Schema(description = "任务ID")
    private Long taskId;

    @Schema(description = "任务标题")
    private String taskTitle;

    @Schema(description = "学生信息")
    private StudentInfo student;

    @Schema(description = "状态：PENDING/SUBMITTED/REVIEWED")
    private String status;

    @Schema(description = "状态文本：待完成/已提交/已评价")
    private String statusText;

    @Schema(description = "照片URL数组")
    private List<String> photos;

    @Schema(description = "视频URL")
    private String videoUrl;

    @Schema(description = "语音URL")
    private String audioUrl;

    @Schema(description = "完成内容/阅读心得")
    private String content;

    @Schema(description = "提交时间")
    private LocalDateTime submittedAt;

    @Schema(description = "评价时间")
    private LocalDateTime reviewedAt;

    @Schema(description = "教师评价")
    private TaskFeedbackResponse feedback;

    /**
     * 学生信息
     */
    @Data
    @Builder
    @Schema(description = "学生信息")
    public static class StudentInfo {

        @Schema(description = "学生ID")
        private Long id;

        @Schema(description = "学生姓名")
        private String name;

        @Schema(description = "学生头像")
        private String avatar;

        @Schema(description = "性别：MALE/FEMALE")
        private String gender;

        @Schema(description = "班级信息")
        private ClassInfo classInfo;

    }

    /**
     * 班级信息
     */
    @Data
    @Builder
    @Schema(description = "班级信息")
    public static class ClassInfo {

        @Schema(description = "班级ID")
        private Long id;

        @Schema(description = "班级名称")
        private String name;

        @Schema(description = "年级")
        private String grade;

    }

}
