"""
Module: src.shared.models
Workorder: WO01
Purpose: Shared typed models for transcript export payload.

Dependencies:
    - pydantic: Model base classes

Inputs:
    - Model initialization values

Outputs:
    - Typed models for metadata, segments and export payload

Key Functions/Classes:
    - SessionMetadata: Session model
    - TranscriptSegment: Segment model
    - OllamaOutput: Optional post-processing output
    - TranscriptExport: Export payload model

Tests: tests/unit/test_placeholder.py
"""
from pydantic import BaseModel, Field


class SessionMetadata(BaseModel):
    """Session metadata model."""

    date: str
    source: str
    language: str


class TranscriptSegment(BaseModel):
    """Transcript segment model."""

    speaker: str
    start: float = Field(ge=0.0)
    end: float = Field(ge=0.0)
    text: str
    confidence: float = Field(ge=0.0, le=1.0)


class OllamaOutput(BaseModel):
    """Optional Ollama post-processing output model."""

    model: str
    host: str
    text: str
    summary: str | None = None
    action_items: list[str] = []
    title: str | None = None
    topic: str | None = None
    speakers: list[str] = []
    outcomes: list[str] = []


class TranscriptExport(BaseModel):
    """Primary transcript export model."""

    session_metadata: SessionMetadata
    vocabulary_boosted: list[str]
    segments: list[TranscriptSegment]
    ollama_output: OllamaOutput | None = None

