package com.competition.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.competition.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

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

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

    @Schema(description = "作业名称")
    private String name;

    @Schema(description = "作业内容")
    private String content;

    @Schema(description = "提交开始时间")
    @TableField("submit_start_time")
    private LocalDateTime submitStartTime;

    @Schema(description = "提交结束时间")
    @TableField("submit_end_time")
    private LocalDateTime submitEndTime;

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

    @Schema(description = "发布范围（JSON）")
    @TableField(value = "publish_scope", typeHandler = JacksonTypeHandler.class)
    private Object publishScope;

    @Schema(description = "评审规则ID")
    @TableField("review_rule_id")
    private Long reviewRuleId;

    @Schema(description = "状态：unpublished/published")
    private String status;

    @Schema(description = "发布时间")
    @TableField("publish_time")
    private LocalDateTime publishTime;
}
