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_schedule_plan")
@Schema(description = "课表计划")
public class SchedulePlan {

    @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 = "计划名称", example = "周一上午课程", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

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

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

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

    @Schema(description = "星期几 (1-7)", example = "1", minimum = "1", maximum = "7")
    private Integer dayOfWeek;

    @Schema(description = "第几节课", example = "1", minimum = "1")
    private Integer period;

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

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

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

    @Schema(description = "结束日期")
    private LocalDate endDate;

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

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

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

    @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 = "是否删除 0-未删除 1-已删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
