aeat.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 the operator. The semantic shape is the contract that the repair renderer reads from.- Parameters:
- 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: str¶
- exception WizardStatusError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
WizardErrorRaised when the wizard status projection cannot resolve the active profile.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- build_wizard_status(state)[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)
- load_active_taxpayer_profile(state)[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.- 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.