Source code for aeat.core.resources._repos.legal_parameters
"""Singleton legal-parameter repository.:class:`LegalParameterRepository` loads registry-wide :class:`LegalParameter`records through the shared :class:`ResourceCacheRepository` cache."""from__future__importannotationsfromcollections.abcimportMappingfromtypingimportTYPE_CHECKING,overridefrom.._repositoryimportResourceCacheRepositoryifTYPE_CHECKING:from....domain.calculations.registryimportLegalParameter
[docs]classLegalParameterRepository(ResourceCacheRepository[Mapping[str,"LegalParameter"],None]):"""Singleton-keyed repository for the registry-wide legal parameters. Wraps :func:`aeat.domain.calculations.registry.load_legal_parameters_only` rooted at the bundled registry tree and returns :class:`LegalParameter` records. """@overridedef_load(self,key:None)->Mapping[str,LegalParameter]:from....domain.calculations.registryimportload_legal_parameters_onlyfrom.._boundaryimportbundled_pathreturnload_legal_parameters_only(bundled_path("registry","aeat"))@propertydefsingleton(self)->Mapping[str,LegalParameter]:returnself.get(None)