aeat.application.modelo._registry_resources module¶
Registry resource helpers shared by modelo application actions.
Modelo application services access the packaged registry through the central
ValidatedRegistryAuthority exposed by resources().modelos.authority.
This module keeps that access path in one place for work-unit creation,
calculation, verification, import, and comparison code that needs the bundled
registry/aeat tree or its cached authority.
The revision and period guards are create-work-unit checks: they reject user input that names a modelo revision or filing period the committed registry does not declare, before a work unit records a law-determined registry identity.
See also
aeat.core.resources:Owns the packaged resource registry and bundled-path resolution.
aeat.domain.calculations.registry.ValidatedRegistryAuthority:Loads and validates modelo definitions, then serves registry snapshots.
aeat.application.modelo._registry_helpers:Uses this authority helper for import/amendment registry checks.
- registry_root()[source]¶
Return the bundled
registry/aeatroot used by modelo services.The returned
Pathis the path passed to registry-facing errors when the packaged registry cannot be loaded. It intentionally mirrors the root used byauthority_via_resources().- Return type:
Path
- authority_via_resources()[source]¶
Return the central
ValidatedRegistryAuthorityfor modelo registry access.Callers use this instead of constructing a local authority so calculation, verification, import, and create-work-unit paths share the same packaged registry cache and source-root configuration.
- Return type:
- reject_unknown_revision(*, modelo, revision_id)[source]¶
Refuse a work-unit create that names an undeclared revision id.
The central
ValidatedRegistryAuthorityfirst resolves the modelo definition. If the modelo exists butrevision_idis absent from its revision map, this raisesModeloErrorwith the available revision ids.
- reject_unknown_period_for_revision(*, modelo, revision_id, period)[source]¶
Refuse a work-unit create whose
Periodis absent from the revision schedules.The guard inspects the named revision’s filing schedules and compares the caller’s
period.registry_tokento the declared period tokens. A revision with no declared schedule is accepted here; a missing revision is also left alone becausereject_unknown_revision()owns that refusal.