package com.reading.platform.entity;

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

import java.time.LocalDateTime;

/**
 * 通知实体
 */
@Data
@TableName("t_notification")
@Schema(description = "系统通知")
public class Notification {

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

    @Schema(description = "通知内容", requiredMode = Schema.RequiredMode.REQUIRED)
    private String content;

    @Schema(description = "通知类型", example = "system", allowableValues = {"system", "task", "lesson", "other"})
    private String type;

    @Schema(description = "发送人 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String senderId;

    @Schema(description = "发送人角色", example = "admin", requiredMode = Schema.RequiredMode.REQUIRED)
    private String senderRole;

    @Schema(description = "接收者类型", example = "all", allowableValues = {"all", "teacher", "parent", "student"})
    private String recipientType;

    @Schema(description = "接收者 ID")
    private String recipientId;

    @Schema(description = "是否已读", example = "0")
    private Integer isRead;

    @Schema(description = "阅读时间")
    private LocalDateTime readAt;

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

}
