package com.lingyue.extract.entity;

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

import java.util.Map;

/**
 * 数据提取项目实体
 * 
 * 一个项目代表一个报告生成任务，包含多个来源文档和提取规则
 * 
 * @author lingyue
 * @since 2026-01-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "extract_projects", autoResultMap = true)
@Schema(description = "数据提取项目")
public class Project extends SimpleModel {
    
    @Schema(description = "用户ID")
    @TableField("user_id")
    private String userId;
    
    @Schema(description = "项目名称")
    @TableField("name")
    private String name;
    
    @Schema(description = "项目描述")
    @TableField("description")
    private String description;
    
    @Schema(description = "状态: draft-草稿, extracting-提取中, completed-已完成, archived-已归档")
    @TableField("status")
    private String status;
    
    @Schema(description = "项目配置")
    @TableField(value = "config", typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> config;
    
    // ==================== 状态常量 ====================
    
    public static final String STATUS_DRAFT = "draft";
    public static final String STATUS_EXTRACTING = "extracting";
    public static final String STATUS_COMPLETED = "completed";
    public static final String STATUS_ARCHIVED = "archived";
}
