aeat.core.resources._repos.manuals module

ManualRepository: composite-keyed Manual catalogue.

The composite key is (manual_id, year, part) modelled as a frozen ManualKey record. The ManualRepository wraps the existing loader chain in aeat.domain.manuals; the Settings env-override for AEAT_MANUALS_ROOT is preserved verbatim by passing the operator-resolved root through the constructor.

class ManualKey(**data)[source]

Bases: TypedResourceKey

Composite key (manual_id, year, part) for a Manual record.

Parameters:
manual_id: str
year: int
part: str
class ManualRepository(root=None)[source]

Bases: ResourceCacheRepository[Manual, ManualKey]

Composite-key repository for the bundled Manual catalogue.

Wraps aeat.domain.manuals.load_manual() and stays in lockstep with the env-override seam on Settings.aeat_manuals_root. The repository returns Manual records keyed by ManualKey.

Parameters:

root (Path | None)

catalogue(specs)[source]

Return a ManualCatalogue aggregate for specs.

Return type:

ManualCatalogue

Parameters:

specs (Iterable[tuple[ManualId, int, ManualPart]])

find_rules(catalogue, *, casilla_reference=None, kind=None, lang=None)[source]

Delegate to aeat.domain.manuals.find_rules() for rule queries.

Yields each matching Rule from the catalogue in encounter order.

Return type:

Iterator[Rule]

Parameters:
iter_sections(manual)[source]

Delegate to aeat.domain.manuals.iter_sections() for section iteration.

Yields each Section from manual in document order.

Return type:

Iterator[Section]

Parameters:

manual (Manual)