from __future__ import annotations

from dataclasses import dataclass


@dataclass(slots=True)
class ParsedTopLevelSection:
    title: str
    content: str


@dataclass(slots=True)
class ParsedSubsection:
    title: str
    content: str
    path: str


@dataclass(slots=True)
class ParsedDocument:
    frontmatter: dict
    title: str
    summary: str
    details: str
    body: str
    detail_sections: list[ParsedSubsection]


@dataclass(slots=True)
class WorkflowScenario:
    name: str
    preconditions: list[str]
    trigger: list[str]
    main_flow: list[str]
    alternative_flow: list[str]
    error_handling: list[str]
    postconditions: list[str]
    anchor: str


@dataclass(slots=True)
class IntegrationRecord:
    name: str
    target: str
    target_type: str
    direction: str
    interaction: str
    via: str
    purpose: str
    details: dict
    anchor: str


@dataclass(slots=True)
class RelationEdge:
    source_id: str
    relation_type: str
    target_id: str
    anchor: str
