agilentics / boiler
"""Business logic, shared by every façade.

The rule this package enforces: a façade authenticates, deserialises and
serialises - nothing else. Every decision about what may be read or written lives
here, so a web UI and an API added later cannot drift into disagreeing about it.

Two consequences, both easy to undo by accident:

  * Nothing here imports `db_session`. Every function takes its session as an
    argument, which keeps the logic testable without a Flask request context and
    usable from any façade (including a CLI and a migration).

  * Nothing here raises an HTTP error. The core raises the domain errors below
    and each façade maps them to its transport's idea of a failure.
"""
from .context import (
    ALL_SCOPES,
    Conflict,
    CoreError,
    Forbidden,
    Invalid,
    NotFound,
    Principal,
    Scope,
    scope_to_org,
)

__all__ = [
    "ALL_SCOPES",
    "Conflict",
    "CoreError",
    "Forbidden",
    "Invalid",
    "NotFound",
    "Principal",
    "Scope",
    "scope_to_org",
]