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/aeat root used by modelo services.

The returned Path is the path passed to registry-facing errors when the packaged registry cannot be loaded. It intentionally mirrors the root used by authority_via_resources().

Return type:

Path

authority_via_resources()[source]

Return the central ValidatedRegistryAuthority for 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:

ValidatedRegistryAuthority

reject_unknown_revision(*, modelo, revision_id)[source]

Refuse a work-unit create that names an undeclared revision id.

The central ValidatedRegistryAuthority first resolves the modelo definition. If the modelo exists but revision_id is absent from its revision map, this raises ModeloError with the available revision ids.

Return type:

None

Parameters:
  • modelo (str)

  • revision_id (str)

reject_unknown_period_for_revision(*, modelo, revision_id, period)[source]

Refuse a work-unit create whose Period is absent from the revision schedules.

The guard inspects the named revision’s filing schedules and compares the caller’s period.registry_token to the declared period tokens. A revision with no declared schedule is accepted here; a missing revision is also left alone because reject_unknown_revision() owns that refusal.

Return type:

None

Parameters: