package com.lesingle.edu.dto.response;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 任务响应
 * 用于返回任务信息给前端
 */
@Data
@Builder
@Schema(description = "任务响应")
public class TaskResponse {

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

    @Schema(description = "租户 ID")
    private Long tenantId;

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

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

    @Schema(description = "任务类型")
    @JsonProperty("taskType")
    @JsonAlias({"type"})
    private String type;

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

    @Schema(description = "课程 ID")
    private Long courseId;

    @Schema(description = "创建人 ID")
    private Long creatorId;

    @Schema(description = "创建人角色")
    private String creatorRole;

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

    @Schema(description = "截止日期")
    @JsonProperty("endDate")
    @JsonAlias({"dueDate"})
    private LocalDate dueDate;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "附件")
    private String attachments;

    @Schema(description = "目标类型：CLASS-班级，STUDENT-学生")
    private String targetType;

    @Schema(description = "目标 IDs（班级或学生）")
    private java.util.List<Long> targetIds;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "目标人数（任务分配的学生总数）")
    private Integer targetCount;

    @Schema(description = "已完成人数（已提交或已评价）")
    private Integer completionCount;
}
