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;

/**
 * 学生班级历史实体
 */
@Data
@TableName("t_student_class_history")
@Schema(description = "学生班级历史")
public class StudentClassHistory {

    @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 studentId;

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

    @Schema(description = "开始日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
    private LocalDate startDate;

    @Schema(description = "结束日期", example = "2024-06-30")
    private LocalDate endDate;

    @Schema(description = "状态 active/graduated/transferred", example = "active")
    private String status;

    @Schema(description = "调班原因")
    private String reason;

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

}
