aeat.adapters.persistence.profile.participation_index module¶
Encrypted persistence for the transaction-to-revision participation index.
The participation index is a derived, rebuildable read-side cache linking one
ledger transaction id to the finalized modelo revisions, filings, and
justificantes that consumed it. This concrete repository is the persistence
adapter behind the pure modelos index model: it stores one
Envelope per transaction at
SensitivityClass FINANCIAL under the
active profile bucket, mirroring the CalculationRevision
catalogue repository.
Living in the persistence adapter (not in modelos) keeps the
SecureObjectRepository /
Envelope coupling out of the domain
layer; the domain package owns only the typed index model, its derivation, and
the object-key grammar. The index is critically sensitive financial data; no
plaintext index is ever written to disk.
- class TransactionParticipationIndexRepository(*, bucket_id=None, objects=None)[source]¶
Bases:
objectRead / write one transaction’s participation index in encrypted storage.
Mirrors the
CalculationRevisioncatalogue repository: persistence is delegated toSecureObjectRepositoryatSensitivityClassFINANCIAL under the active profile bucket, one secure object pertransaction_id. The participation index is critically sensitive financial data (it links a ledger transaction to its filings); no plaintext index is ever written to disk.- Parameters:
bucket_id (str | None)
objects (SecureObjectRepository | None)
- property bucket_id: str | None¶
Identifier of the per-profile storage bucket this repository reads and writes.
- property secure_object_repository: SecureObjectRepository¶
Return the
SecureObjectRepositorybackend.
- exists(transaction_id)[source]¶
Report whether a participation index has been persisted for
transaction_id.
- load(transaction_id)[source]¶
Load and decrypt one transaction’s persisted participation index.
Returns an empty
TransactionRevisionParticipationIndexfor that transaction when nothing has been persisted yet, rather than raising.- Return type:
- Parameters:
transaction_id (str)
- save(index)[source]¶
Persist one transaction’s participation index to encrypted storage.
- Return type:
- Parameters:
- to_secure_object_write(index)[source]¶
Return the
SecureObjectWriteupsert forindexwithout committing it.Mirrors the bucket-event-history repository so the participation write can be passed to
save_with_secure_object_writesas an extra write slot, co-emitting atomically with the revision save.- Return type:
- Parameters: