package com.lingyue.parse.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lingyue.common.domain.entity.SimpleModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 解析任务实体
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "parse_tasks", autoResultMap = true)
@Schema(description = "解析任务实体")
public class ParseTask extends SimpleModel {
    
    @Schema(description = "文档ID")
    @TableField("document_id")
    private String documentId;
    
    @Schema(description = "状态")
    @TableField("status")
    private String status = "pending"; // pending/processing/completed/failed
    
    @Schema(description = "进度")
    @TableField("progress")
    private Integer progress = 0; // 0-100
    
    @Schema(description = "当前步骤")
    @TableField("current_step")
    private String currentStep;
    
    @Schema(description = "错误消息")
    @TableField("error_message")
    private String errorMessage;
    
    @Schema(description = "选项")
    @TableField(value = "options", typeHandler = com.lingyue.common.mybatis.PostgreSqlJsonbTypeHandler.class)
    private Object options;
    
    @Schema(description = "开始时间")
    @TableField("started_at")
    private Date startedAt;
    
    @Schema(description = "完成时间")
    @TableField("completed_at")
    private Date completedAt;
}
