package com.lesingle.modules.biz.homework.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.lesingle.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "t_biz_homework_submission", autoResultMap = true)
@Schema(description = "作业提交实体")
public class BizHomeworkSubmission extends BaseEntity {

    @Schema(description = "租户ID")
    @TableField("tenant_id")
    private Long tenantId;

    @Schema(description = "作业ID")
    @TableField("homework_id")
    private Long homeworkId;

    @Schema(description = "学生ID")
    @TableField("student_id")
    private Long studentId;

    @Schema(description = "作品编号")
    @TableField("work_no")
    private String workNo;

    @Schema(description = "作品名称")
    @TableField("work_name")
    private String workName;

    @Schema(description = "作品描述")
    @TableField("work_description")
    private String workDescription;

    @Schema(description = "作品文件（JSON）")
    @TableField(value = "files", typeHandler = JacksonTypeHandler.class)
    private Object files;

    @Schema(description = "附件（JSON）")
    @TableField(value = "attachments", typeHandler = JacksonTypeHandler.class)
    private Object attachments;

    @Schema(description = "提交时间")
    @TableField("submit_time")
    private LocalDateTime submitTime;

    @Schema(description = "状态：pending/reviewed")
    private String status;

    @Schema(description = "总分")
    @TableField("total_score")
    private BigDecimal totalScore;
}
