package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 任务完成实体
 */
@Data
@TableName("t_task_completion")
@Schema(description = "任务完成信息")
public class TaskCompletion {

    @Schema(description = "任务完成 ID", accessMode = Schema.AccessMode.READ_ONLY)
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "任务 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String taskId;

    @Schema(description = "学生 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String studentId;

    @Schema(description = "完成状态", example = "completed", allowableValues = {"pending", "completed", "incomplete"})
    private String status;

    @Schema(description = "完成时间")
    private LocalDateTime completedAt;

    @Schema(description = "完成内容")
    private String content;

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

    @Schema(description = "评分", example = "5", minimum = "1", maximum = "5")
    private Integer rating;

    @Schema(description = "反馈内容")
    private String feedback;

    @Schema(description = "创建者用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    @Schema(description = "更新者用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @Schema(description = "逻辑删除标志", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
