"""
Tailmatter statistics data structures.
"""

from dataclasses import dataclass
from typing import Dict, Any, Optional


@dataclass
class TailmatterStats:
    """Statistics about tailmatter in a markdown document."""

    has_tailmatter: bool
    format: Optional[str]  # "yaml", "json"
    total_fields: int
    qa_items: int
    qa_completed: int
    editorial_status: Optional[str]
    has_agent_config: bool

    def to_dict(self) -> Dict[str, Any]:
        """Convert stats to dictionary."""
        return {
            "has_tailmatter": self.has_tailmatter,
            "format": self.format,
            "total_fields": self.total_fields,
            "qa_items": self.qa_items,
            "qa_completed": self.qa_completed,
            "editorial_status": self.editorial_status,
            "has_agent_config": self.has_agent_config
        }