aeat.application.user_profile._preflight module¶
Preflight service: which schema fields a given modelo/revision needs.
ProfilePreflightService inspects the schema’s model_selectors
against a UserProfileRecord and returns a
ProfilePreflightReport listing every required field that the
record does not yet carry.
- class ProfilePreflightService(*, schema)[source]¶
Bases:
objectResolve required profile selectors for a given
(modelo, revision, year, period).The service inspects the loaded schema’s
model_selectorsandschedule_predicatesdeclarations. Today every required field whosemodel_selectorsreference the target modelo is considered required; revision-specific filtering will land alongside the registry-time selector inventory work.- Parameters:
schema (ProfileSchemaDefinition)
- report(*, record, modelo, revision_id, period, revision=None)[source]¶
Compute missing required profile fields for the given filing context.
Walks every section and field in the schema. A field is considered required for this filing when
field.requiredis true and at least one of itsmodel_selectorshas the prefixmodelo_<modelo>. Facts already present onrecordare excluded from the missing list.- Parameters:
record (
UserProfileRecord) – The caller’s currentUserProfileRecord.modelo (
str) – Numeric modelo identifier (e.g."303").revision_id (
str) – Revision tag from the registry (e.g."2024-0A").period (
Period) – Typed filing period.revision (
ModeloRevision|None) – OptionalModeloRevisionwhose export layouts contribute filing-grade declarant identity requirements.
- Return type:
- Returns:
A
ProfilePreflightReportwithready=Truewhen all required fields are present, orready=Falsewith themissinglist populated.