"""Content classification models for the content intelligence pipeline."""
from enum import Enum
from typing import Any, Dict, List, Optional

from pydantic import BaseModel

from services.attachment_parser_service import ImageInfo, TableData


class ContentBlockType(str, Enum):
    narrative = "narrative"
    quote = "quote"
    metric = "metric"
    table = "table"
    timeline = "timeline"
    comparison = "comparison"
    list_items = "list_items"
    image_reference = "image_reference"
    call_to_action = "call_to_action"


class ContentBlock(BaseModel):
    type: ContentBlockType
    raw_text: str
    extracted_data: Optional[Dict[str, Any]] = None
    source_section: Optional[str] = None
    priority: int = 5  # 1-10


class ClassifiedContent(BaseModel):
    title: Optional[str] = None
    blocks: List[ContentBlock]
    tables: List[TableData] = []
    images: List[ImageInfo] = []
    summary: str = ""
