aeat.core.resources._registry module

Central resource registry and process-wide factory.

The ResourceRegistry aggregates every ResourceRepository the project exposes. The resources() factory builds the registry once per process; subsequent calls return the cached instance. Tests that override aeat.core.config.Settings to change the bundled-data location must call resources.cache_clear() to force a rebuild on the next access.

class ResourceRegistry(apoderamientos=<factory>, category_profiles=<factory>, holiday_calendars=<factory>, legal_parameters=<factory>, manuals=<factory>, modelos=<factory>, recargo_bands=<factory>, topics=<factory>, user_profile_schema=<factory>, iva_catalogues=<factory>, iva_rate_tables=<factory>)[source]

Bases: object

Aggregate of every Repository the project exposes.

Each field holds one ResourceRepository instance owning its own Identity Map. The clear() method empties every Repository’s cache uniformly; tests that override Settings between cases call it via the module-level resources() factory’s cache_clear.

Parameters:
apoderamientos: ApoderamientosRepository
category_profiles: CategoryProfileRepository
holiday_calendars: HolidayCalendarRepository
legal_parameters: LegalParameterRepository
manuals: ManualRepository
modelos: StaticModeloRepository
recargo_bands: RecargoBandsRepository
topics: TopicCatalogueRepository
user_profile_schema: UserProfileSchemaRepository
iva_catalogues: IvaCatalogueRepository
iva_rate_tables: IvaRateTableRepository
clear()[source]

Clear every Repository’s Identity Map.

Return type:

None

resources()[source]

Return the process-wide resource registry.

Cached at first call. The factory reads Settings once at construction and threads operator-supplied roots through to the Repositories that honour an env-override seam (manuals and iva catalogues). Tests that mutate Settings between cases call resources.cache_clear() to rebuild with the new values.

Return type:

ResourceRegistry

Returns:

The process-wide cached ResourceRegistry instance.