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: object

Resolve required profile selectors for a given (modelo, revision, year, period).

The service inspects the loaded schema’s model_selectors and schedule_predicates declarations. Today every required field whose model_selectors reference 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.required is true and at least one of its model_selectors has the prefix modelo_<modelo>. Facts already present on record are excluded from the missing list.

Parameters:
Return type:

ProfilePreflightReport

Returns:

A ProfilePreflightReport with ready=True when all required fields are present, or ready=False with the missing list populated.