aeat.core.wizard_catalogue module¶
Canonical registry slot for the wizard-flow catalogue.
Domain modules that need to inspect SETUP_FLOW or WIZARD_FLOWS
import from here, never from application.wizard._catalogue. This
module is the core slot that holds already-built descriptors; it does not build
wizard sections, render prompts, compile profile keys, persist answers, or
own the core.setup_answers typed answer model.
The application layer registers the concrete descriptors at startup via
register_wizard_catalogue(). Until registration, the accessors
get_setup_flow() and get_wizard_flows() raise
WizardCatalogueNotRegisteredError so any premature domain access
surfaces immediately rather than silently falling back to an upward dependency.
The protocol this module defines (WizardFlowProtocol) is satisfied by
application.wizard._models.WizardFlow. Domain code depends only on the
structural slot and the accessor functions; the concrete descriptor class stays
owned by the application wizard package.
- exception WizardCatalogueNotRegisteredError[source]¶
Bases:
CoreErrorRaised when a domain consumer accesses the catalogue before registration.
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception WizardCatalogueAlreadyRegisteredError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
CoreErrorRaised when
register_wizard_catalogue()receives different objects after registration.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class WizardFlowProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolStructural type satisfied by WizardFlow descriptors.
The protocol captures the smallest attribute core consumers need for diagnostics. Accessors still return the concrete descriptor object, but domain code reaches it through this core slot and never imports the application-layer
WizardFlowclass directly.
- register_wizard_catalogue(setup_flow, wizard_flows)[source]¶
Register the concrete wizard-flow descriptors from the application layer.
Call this exactly once at application startup (e.g. in the
application.wizard._cataloguemodule body, after theSETUP_FLOW/WIZARD_FLOWSconstants are built).Calling with identical objects a second time is a no-op. Calling with different objects raises
WizardCatalogueAlreadyRegisteredErrorto prevent accidental re-registration from a different source. The function stores object identity only; it does not copy, validate, or normalise the application-owned descriptors.
- get_setup_flow()[source]¶
Return the registered
SETUP_FLOWdescriptor.- Return type:
- Returns:
The concrete
SETUP_FLOWdescriptor registered by the application layer. Callers should treat it as the canonical setup-flow descriptor and should not importapplication.wizard._catalogueas a fallback.- Raises:
WizardCatalogueNotRegisteredError – When the application layer has not yet called
register_wizard_catalogue().
- get_wizard_flows()[source]¶
Return the registered
WIZARD_FLOWStuple.- Return type:
- Returns:
Tuple of concrete wizard-flow descriptors registered by the application layer. The tuple identity is preserved so downstream consumers inspect the same catalogue object the application registered.
- Raises:
WizardCatalogueNotRegisteredError – When the application layer has not yet called
register_wizard_catalogue().