aeat.domain.invoices._protocols module¶
Domain-level repository Protocol for the invoice catalogue.
Application-layer code that persists or loads the InvoiceCatalogue
depends on InvoiceCatalogueRepositoryProtocol,
not on the concrete secure-object-backed InvoiceCatalogueRepository.
This keeps callers typed against the narrow port while the concrete repository
owns the adapter integration.
- class InvoiceCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the invoice catalogue.
Any object that provides
exists,load, andsaveover a per-bucketInvoiceCataloguesatisfies this protocol. The production implementation isInvoiceCatalogueRepository.- load()[source]¶
Return the persisted catalogue or an empty catalogue if absent.
- Return type:
- Returns:
The
InvoiceCatalogueloaded from storage.
- save(catalogue)[source]¶
Persist
catalogueatomically under the file lock.- Parameters:
catalogue (
InvoiceCatalogue) – TheInvoiceCatalogueto persist.- Return type: