aeat.core.resources._repos.modelos module

StaticModeloRepository: thin façade over ValidatedRegistryAuthority.

The modelos repository is the only one that backs onto an aggregate (ValidatedRegistryAuthority) rather than a direct loader. The authority owns the validator + snapshot caches that the test suite already relies on; the Repository preserves those caches by holding a reference to the authority instance and delegating get / all through it. Both return ModeloDefinition records resolved from the authority.

class StaticModeloRepository(root=None, source_root=None)[source]

Bases: ResourceCacheRepository[ModeloDefinition, str]

Modelo definitions keyed by their typed id ("100", "180", …).

Wraps aeat.domain.calculations.registry.ValidatedRegistryAuthority. The authority is constructed lazily on first get so the bundled registry only loads when actually needed.

Parameters:
  • root (Path | None)

  • source_root (Path | None)

property authority: ValidatedRegistryAuthority

Return the backing ValidatedRegistryAuthority instance.

all()[source]

Return every modelo definition in the bundled registry.

Return type:

tuple[ModeloDefinition, ...]

Returns:

A tuple of every ModeloDefinition known to the backing authority.

clear_cache()[source]

Clear the Identity Map AND the backing authority reference.

Return type:

None