cadrumo.adapters.persistence.profile.translated_bucket_event_history module¶
Bucket-event history exposed through an application-owned failure contract.
Several declaration lifecycles commit their bucket events beside their own records. Each binds the same encrypted history repository to the application port and differs only in which application error a storage failure becomes, so the binding is written once and the translation is supplied by the caller.
- class AdapterFailureTranslator(*args, **kwargs)[source]¶
Bases:
ProtocolRun one adapter operation, re-raising storage failures as an application error.
- class TranslatedBucketEventHistoryRepository(*, repository, translate)[source]¶
Bases:
BucketEventHistoryRepositoryProtocolTranslate bucket-event persistence to one application contract.
- Parameters:
repository (BucketEventHistoryRepository)
translate (AdapterFailureTranslator)
- load_revisioned()[source]¶
Load event history together with its optimistic-concurrency revision.
- Return type:
- save(catalogue)[source]¶
Persist event history while translating storage failures.
- Return type:
- Parameters:
catalogue (BucketEventHistoryCatalogue)
- to_secure_object_write(catalogue, *, expected_revision_id=None)[source]¶
Prepare an event-history secure write for an atomic commit.
- Return type:
- Parameters:
catalogue (BucketEventHistoryCatalogue)
expected_revision_id (str | None)