aeat.domain.transactions._repository module¶
Domain-side transaction-catalogue port surface.
This module owns the pure transaction-catalogue persistence vocabulary that
carries no SQL/crypto coupling: the ImportSummary record returned by a
ledger import, the transaction_object_key() /
transaction_index_object_key() secure-object key-derivation helpers, and
the TX_BUCKET_NAMESPACE / schema-version constants that name the
persisted envelope contract. The concrete encrypted SQL repository lives in the
persistence adapter
TransactionCatalogueRepository,
behind the read-side
TransactionCatalogueRepositoryProtocol; the
domain package depends only on the structural port.
The namespace authority is
adapters.persistence.storage.TRANSACTION_CATALOGUE_NAMESPACE; this module
derives the bucket-local transaction row keys with transaction_object_key()
and the membership-index key with transaction_index_object_key().
- transaction_index_object_key(bucket_id)[source]¶
Return the per-bucket transaction-membership-index secure-object key.
The index row shares
adapters.persistence.storage.TRANSACTION_CATALOGUE_NAMESPACEwith the per-transaction rows and bounds reads/deletions to one bucket.
- transaction_object_key(bucket_id, transaction_id)[source]¶
Return the per-transaction secure-object key within a profile bucket.
Each transaction is its own secure-object row. The key qualifies with the bucket id (
transaction:{bucket_id}:{transaction_id}); cross-bucket aggregation must qualify with(bucket_id, tx_id)becausetx_idalone is unique only within one bucket. Rows live underadapters.persistence.storage.TRANSACTION_CATALOGUE_NAMESPACE.
- class ImportSummary(**data)[source]¶
Bases:
BaseModelFrozen summary of one ledger import persistence operation.
- Variables:
imported – Number of new transactions persisted by this call.
skipped – Number of input rows already present in the catalogue. A row is a duplicate when its stable import fingerprint (
derive_import_fingerprint()) is already present — the fingerprint is stamped at import and survives both later edits and a re-export in a different file format.errors – Reserved for future per-row error counts; today the repository raises on any error rather than tallying.
likely_duplicate_refs – Rows that were imported but share an effective date and amount with an existing transaction while carrying a divergent narrative — a probable, but not confident, cross-format duplicate. The operator is warned so they can review rather than discovering a silent double-count later.
catalogue_path – Logical URI of the encrypted database object.
- Parameters:
imported (int)
skipped (int)
errors (int)
bucket_id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=128, pattern=None, ascii_only=None)])
imported_refs (tuple[BucketTransactionRef, ...])
skipped_refs (tuple[BucketTransactionRef, ...])
likely_duplicate_refs (tuple[BucketTransactionRef, ...])
catalogue_path (str)
- imported: int¶
- skipped: int¶
- errors: int¶
- bucket_id: BucketId¶
- imported_refs: tuple[BucketTransactionRef, ...]¶
- skipped_refs: tuple[BucketTransactionRef, ...]¶
- likely_duplicate_refs: tuple[BucketTransactionRef, ...]¶
- catalogue_path: str¶