"""Domain model for the Entity type."""
from __future__ import annotations

from datetime import datetime

from repo_core.base.models import DomainModel


class Entity(DomainModel):
    """Generic strongly-typed domain entity.

    Use as a base for more specialised entity models, or directly when a
    lightweight keyed record is all that is needed::

        entity = Entity.from_db({"id": "abc-123", "name": "Acme Corp"})
        row = entity.to_db()
    """

    id: str
    name: str
    description: str = ""
    active: bool = True
    created_at: datetime | None = None
    updated_at: datetime | None = None
