cadrumo.application.wizard.status module¶
Profile-status projection and the active-profile to TaxpayerProfile bridge.
build_wizard_status projects the active workflow state into a
strict WizardStatusReport consumed by the config repair surface
and the aeat config profile status command. load_active_taxpayer_profile
is the typed bridge the deadline engine and the filing runtime call
to obtain an TaxpayerProfile from the active profile bucket.
- class WizardStatusReport(**data)[source]¶
Bases:
BaseModelReadiness summary for the active configuration profile.
Surfaces both the structural readiness (identity-required keys present) and the enrolment readiness (IVA regime declared) so the config repair’s profile + auth checks can render a precise
next_actionfor a fully-addressable operator continuation. A status row carries no executable action when its next step needs new operator input or custody has made the old interactive create path unavailable.- Parameters:
data (Any)
- active_profile: str | None¶
- profile_ready: bool¶
- identity_ready: bool¶
- enrolment_ready: bool¶
- missing_required: tuple[str, ...]¶
- missing_enrolment: tuple[str, ...]¶
- profile_present_keys: int¶
- profile_total_keys: int¶
- auth_provider: str¶
- login_ready: bool¶
- next_action: DeclaredNextAction | None¶
- exception WizardStatusError(message=None, *, context=None, translated_message=None, precondition_verdict=None)[source]¶
Bases:
WizardErrorRaised when the wizard status projection cannot resolve the active profile.
- Parameters:
- Return type:
None
- code¶
- build_wizard_status(state, *, operation)[source]¶
Return the
WizardStatusReportreadiness for the current workflow state.profile_readyis true only when the registry-required keys (identity) are present and, when the taxpayer shape requires IVA enrolment, the IVA regime is also present. A natural-person non-activity profile must not be blocked on a regime declaration it does not need.- Return type:
- Parameters:
state (WorkflowState)
operation (PinnedAuthorityOperation)
- load_active_taxpayer_profile(state, *, schema=None)[source]¶
Build an
TaxpayerProfilefrom the active profile values.The bridge runs the active profile record through the canonical user-profile taxpayer projection, which in turn builds the
TaxpayerProfileconsumed by the deadline engine and filing runtime. Values come from the profile bucket selected by the workflow state.- Parameters:
state (
WorkflowState) – The currentWorkflowStatefrom which the active profile record is resolved.schema (
ProfileSchemaDefinition|None) – The profile schema supplied by the enclosing authority operation. It is required whenstatecontains a profile record; no bundled-schema fallback is permitted.
- Return type:
- Returns:
A
TaxpayerProfilepopulated from the active profile’s canonical answer values.- Raises:
WizardStatusError – When no profile is active or the active profile does not carry a
tax.id.