aeat.domain.transactions._protocols module¶
Domain-level repository Protocol for the transaction catalogue.
Application-layer code that persists or loads the TransactionCatalogue
depends on TransactionCatalogueRepositoryProtocol, not on the concrete
adapter-backed TransactionCatalogueRepository. This keeps the domain
layer free of adapter imports while still providing a typed port surface.
- class TransactionCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the transaction catalogue.
Any object that provides
exists,load,load_for_date_range,partition_by_date_range, andsaveover a per-bucketTransactionCataloguesatisfies this protocol. The concrete secure-object-backed implementation isTransactionCatalogueRepository.- exists()[source]¶
Return whether this bucket’s transaction catalogue has been persisted.
- Return type:
- load()[source]¶
Return the persisted catalogue or an empty catalogue if absent.
- Return type:
- Returns:
The
TransactionCatalogueloaded from storage.
- load_for_date_range(start, end)[source]¶
Return the persisted catalogue filtered to
[start, end]inclusive.Implementations MAY use a non-sensitive routing index to select candidate rows before decrypting, but MUST always return the same result
load()filtered by filing date would return.- Parameters:
- Return type:
- partition_by_date_range(start, end)[source]¶
Split the persisted catalogue into an in-window half and an out-of-window remainder.
Implementations MAY use a non-sensitive routing index to decide the split without decrypting the out-of-window half, but MUST always return the same in-window transaction set
load()filtered by filing date would return. They MUST also represent every remaining catalogue transaction (regardless of any other field) either as row-level out-of-window stubs during migration or as the compact count/date-span summary authorized by the latency ADR – never silently omit one from either half. Summary payloads must carry only plaintext date-index facts, never decrypted transaction fields.- Parameters:
- Return type:
- save(catalogue)[source]¶
Persist
cataloguein the encrypted database object store.- Parameters:
catalogue (
TransactionCatalogue) – TheTransactionCatalogueto persist.- Return type: