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: object

Read / write one transaction’s participation index in encrypted storage.

Mirrors the CalculationRevision catalogue repository: persistence is delegated to SecureObjectRepository at SensitivityClass FINANCIAL under the active profile bucket, one secure object per transaction_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:
property bucket_id: str | None

Identifier of the per-profile storage bucket this repository reads and writes.

property secure_object_repository: SecureObjectRepository

Return the SecureObjectRepository backend.

exists(transaction_id)[source]

Report whether a participation index has been persisted for transaction_id.

Return type:

bool

Parameters:

transaction_id (str)

load(transaction_id)[source]

Load and decrypt one transaction’s persisted participation index.

Returns an empty TransactionRevisionParticipationIndex for that transaction when nothing has been persisted yet, rather than raising.

Return type:

TransactionRevisionParticipationIndex

Parameters:

transaction_id (str)

save(index)[source]

Persist one transaction’s participation index to encrypted storage.

Return type:

None

Parameters:

index (TransactionRevisionParticipationIndex)

to_secure_object_write(index)[source]

Return the SecureObjectWrite upsert for index without committing it.

Mirrors the bucket-event-history repository so the participation write can be passed to save_with_secure_object_writes as an extra write slot, co-emitting atomically with the revision save.

Return type:

SecureObjectWrite

Parameters:

index (TransactionRevisionParticipationIndex)