package com.lesingle.edu.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 学生调班历史单条记录响应
 * 前端期望格式：fromClass、toClass 包含班级信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "学生调班历史单条记录")
public class StudentTransferHistoryItemResponse {

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

    @Schema(description = "调出班级（首次入园为 null）")
    private ClassBasicInfo fromClass;

    @Schema(description = "调入班级")
    private ClassBasicInfo toClass;

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

    @Schema(description = "操作人 ID")
    private Long operatedBy;

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

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "班级基本信息")
    public static class ClassBasicInfo {
        @Schema(description = "班级 ID")
        private Long id;
        @Schema(description = "班级名称")
        private String name;
        @Schema(description = "年级")
        private String grade;
    }
}
