package com.reading.platform.entity;

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

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

/**
 * 课时实体
 */
@Data
@TableName("t_lesson")
@Schema(description = "课时信息")
public class Lesson {

    @Schema(description = "课时 ID", accessMode = Schema.AccessMode.READ_ONLY)
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "租户 ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String tenantId;

    @Schema(description = "课程 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String courseId;

    @Schema(description = "班级 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String classId;

    @Schema(description = "教师 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String teacherId;

    @Schema(description = "课时标题", example = "绘本阅读第一课时", requiredMode = Schema.RequiredMode.REQUIRED)
    private String title;

    @Schema(description = "课时日期", example = "2024-01-01")
    private LocalDate lessonDate;

    @Schema(description = "开始时间", example = "08:00:00")
    private LocalTime startTime;

    @Schema(description = "结束时间", example = "08:45:00")
    private LocalTime endTime;

    @Schema(description = "上课地点", example = "一年级一班教室")
    private String location;

    @Schema(description = "状态", example = "scheduled", allowableValues = {"scheduled", "completed", "cancelled"})
    private String status;

    @Schema(description = "备注说明")
    private String notes;

    @Schema(description = "实际时长（分钟）", example = "45")
    private Integer actualDuration;

    @Schema(description = "整体评分", example = "5", minimum = "1", maximum = "5")
    private String overallRating;

    @Schema(description = "参与度评分", example = "4", minimum = "1", maximum = "5")
    private String participationRating;

    @Schema(description = "完成说明")
    private String completionNote;

    @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)
    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)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @Schema(description = "是否删除 0-未删除 1-已删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
