cadrumo.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 and the transaction_object_key() /
transaction_index_object_key() secure-object key-derivation helpers. The
namespace and schema-version metadata are owned solely by the registry
authority adapters.persistence.storage.secure_object_namespaces.TRANSACTION_CATALOGUE_NAMESPACE;
this domain port never redeclares them. 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.secure_object_namespaces.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.secure_object_namespaces.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.secure_object_namespaces.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.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:
data (Any)
- imported: NonNegativeInt¶
- skipped: NonNegativeInt¶
- bucket_id: BucketId¶
- imported_refs: tuple[BucketTransactionRef, ...]¶
- skipped_refs: tuple[BucketTransactionRef, ...]¶
- likely_duplicate_refs: tuple[BucketTransactionRef, ...]¶
- catalogue_path: str¶