"""Central platform exceptions used across `simorgh.core` and `simorgh.apps`.

These are deliberately small and free of Django imports so they can be raised
from anywhere (services, signals, Celery tasks, management commands).
"""

from __future__ import annotations


class PlatformError(Exception):
    """Base class for all platform-level errors."""


class ConcurrentUpdate(PlatformError):
    """Raised when an optimistic-lock guarded update collides with another writer."""


class ScopeViolation(PlatformError):
    """Raised when a service is asked to operate outside the active tenant/org scope."""


class ContractError(PlatformError):
    """Raised when a module contract (service interface, payload schema) is violated."""


__all__ = ["ConcurrentUpdate", "ContractError", "PlatformError", "ScopeViolation"]
