"""Domain layer: value objects, enums, and domain exceptions. Pure Python — no FastAPI, no SQLAlchemy, no HTTP concerns. Upper layers depend on this package; it depends on nothing except the standard library and small libraries like ``pydantic`` or ``attrs``. """ class DomainError(Exception): """Base class for all domain-level errors. Services raise subclasses of this; the HTTP layer is responsible for mapping them to status codes. Never raise ``HTTPException`` from a service. """ class NotFoundError(DomainError): """Requested entity does not exist.""" class ConflictError(DomainError): """Operation conflicts with the current state (e.g. duplicate, stale version).""" class ValidationError(DomainError): """Input failed domain-level validation (beyond what Pydantic catches).""" class PermissionError(DomainError): """Caller lacks permission for the operation."""