from __future__ import annotations

from dataclasses import dataclass, field
from enum import Enum


class DocAction(str, Enum):
    CREATE = "create"
    EDIT = "update"
    DELETE = "delete"


@dataclass(slots=True)
class AnalyticsMeta:
    analysis_id: str = ""
    application: str = ""
    platform: str = ""
    domain: str = ""
    subdomain: str = ""


@dataclass(slots=True)
class RequirementUnit:
    section_key: str
    heading: str
    body: str
    metadata: dict[str, object] = field(default_factory=dict)


@dataclass(slots=True)
class RequirementTaskContext:
    index: int
    section_key: str
    heading: str
    body: str
    metadata: dict[str, object]
    doc_type: str = ""
    doc_id: str = ""
    application: str = ""
    platform: str = ""
    domain: str = ""
    subdomain: str = ""
    action: DocAction = DocAction.CREATE
    path: str = ""
    issues: list[str] = field(default_factory=list)


@dataclass(slots=True)
class AccumulatedPageDraft:
    path: str
    heading: str
    doc_id: str
    doc_type: str
    platform: str
    action: DocAction
    content: str = ""


@dataclass(slots=True)
class RuleDocument:
    name: str
    content: str
