aeat.application.user_profile._keys_validation module¶
PROFILE_KEYS-driven validation projection used by the CLI status surface.
The wizard catalogue (application/wizard/_catalogue.py) declares
each WizardQuestion.profile_key as a canonical schema-TOML path
(e.g. identity.tax_id, preferences.output_language).
compile_profile_keys produces PROFILE_KEYS as a tuple of
ProfileKey records keyed by those canonical paths. The
helpers in this module project a flat operator-supplied
Mapping[str, str] over that registry and report which required
keys are missing or set so the CLI status surface can render a
deterministic readiness summary.
These helpers are intentionally projection-only: they do not read or
write secure storage, do not touch WorkflowState, and do
not depend on any CLI state. The flat-dict input is produced by
application.user_profile.record_to_values() or by the wizard
runner’s canonical projection.
- class ProfileValidationResult(**data)[source]¶
Bases:
BaseModelTyped result of
validate_profile_values().- Parameters:
- valid: bool¶
- missing_required: tuple[str, ...]¶
- present_required: tuple[str, ...]¶
- present_optional: tuple[str, ...]¶
- unknown_keys: tuple[str, ...]¶
- present_keys: int¶
- total_keys: int¶
- class ProfileValueRow(**data)[source]¶
Bases:
BaseModelOne schema-backed profile value row for CLI/API display.
- Parameters:
key (str)
value (str | None)
is_set (bool)
requirement (ProfileKeyRequirement)
description (str)
- key: str¶
- value: str | None¶
- is_set: bool¶
- requirement: ProfileKeyRequirement¶
- description: str¶
- validate_profile_values(values)[source]¶
Validate
valuesagainstPROFILE_KEYS.valuesis keyed by canonical schema path (identity.tax_id,preferences.output_languageetc.).Returns a
ProfileValidationResult.- Return type:
- Parameters:
- list_profile_key_records()[source]¶
Return the full
PROFILE_KEYStuple in registry order.Each element is a
ProfileKeydescribing one profile field.- Return type:
- list_profile_value_rows(values, *, include_unset=False)[source]¶
Return schema-backed
ProfileValueRowentries for display surfaces.