from __future__ import annotations

from dataclasses import dataclass
from dataclasses import field


@dataclass(slots=True)
class TemplateSection:
    title: str
    level: int
    rule_path: str = ""
    has_children: bool = False


@dataclass(slots=True)
class TemplateSpec:
    doc_type: str
    source_name: str
    template_text: str
    title_level: int = 1
    sections: list[TemplateSection] = field(default_factory=list)


@dataclass(slots=True)
class SectionDraft:
    title: str
    level: int
    content: str
