"""Domain model for the Category entity."""
from __future__ import annotations

from datetime import datetime

from repo_core.base.models import DomainModel


class Category(DomainModel):
    """Hierarchical category with self-referencing parent.

    Categories form a tree via the ``parent_id`` field.  A ``None`` parent
    means this is a root-level category.
    """

    id: int
    title: str
    name: str
    parent_id: int | None = None
    created_at: datetime | None = None
    updated_at: datetime | None = None
