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_growth_record")
@Schema(description = "成长档案记录")
public class GrowthRecord {

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

    @Schema(description = "记录类型", example = "photo", requiredMode = Schema.RequiredMode.REQUIRED)
    private String type;

    @Schema(description = "标题", example = "第一次阅读打卡", requiredMode = Schema.RequiredMode.REQUIRED)
    private String title;

    @Schema(description = "内容", example = "今天完成了第一本绘本阅读")
    private String content;

    @Schema(description = "图片 URLs JSON")
    private String images;

    @Schema(description = "记录人 ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String recordedBy;

    @Schema(description = "记录人角色", example = "parent", accessMode = Schema.AccessMode.READ_ONLY)
    private String recorderRole;

    @Schema(description = "记录日期", example = "2024-01-01")
    private LocalDate recordDate;

    @Schema(description = "标签 JSON")
    private String tags;

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

}
