package com.lesingle.edu.dto.response;

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

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

/**
 * 家长端任务列表响应（含完成信息与教师评价）
 * 对齐前端 TaskWithCompletion 结构
 */
@Data
@Builder
@Schema(description = "家长端任务列表响应（含完成信息）")
public class TaskWithCompletionResponse {

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

    @Schema(description = "学生ID（用于多孩子聚合时标识任务归属）")
    private Long studentId;

    @Schema(description = "完成状态：PENDING-待提交/SUBMITTED-已提交/REVIEWED-已评价")
    private String status;

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

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

    @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 TaskFeedbackResponse teacherFeedback;

    @Schema(description = "任务基本信息")
    private TaskInfo task;

    @Data
    @Builder
    @Schema(description = "任务基本信息")
    public static class TaskInfo {
        @Schema(description = "任务ID")
        private Long id;

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

        @Schema(description = "任务描述")
        private String description;

        @Schema(description = "任务类型")
        private String taskType;

        @Schema(description = "开始日期")
        private LocalDate startDate;

        @Schema(description = "截止日期")
        private LocalDate endDate;

        @Schema(description = "关联绘本名称")
        private String relatedBookName;

        @Schema(description = "关联课程")
        private CourseInfo course;
    }

    @Data
    @Builder
    @Schema(description = "关联课程信息")
    public static class CourseInfo {
        @Schema(description = "课程ID")
        private Long id;

        @Schema(description = "课程名称")
        private String name;
    }
}
