aeat.domain.buckets._event_repository module

Domain boundary error and pure helper for the bucket-event-history catalogue.

BucketEventHistoryPersistenceError is the storage-boundary error the persistence adapter raises when the encrypted BucketEventHistoryCatalogue cannot be loaded or persisted safely; append_bucket_event() is the pure insertion helper over a catalogue. The concrete encrypted-SQL repository lives in the persistence adapter (aeat.adapters.persistence.profile.buckets.BucketEventHistoryRepository), behind BucketEventHistoryRepositoryProtocol; this module owns only the domain error and the pure helper.

exception BucketEventHistoryPersistenceError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: BucketsError

Raised when the bucket-event-history catalogue cannot be persisted or loaded.

This wraps storage-boundary failures from the persistence adapter’s aeat.adapters.persistence.profile.buckets.BucketEventHistoryRepository while preserving translated recovery context for callers.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
append_bucket_event(catalogue, event)[source]

Return a new BucketEventHistoryCatalogue with event inserted.

Content-addressed: a re-emission of the same BucketEvent collapses to the same event_id and the existing entry is left in place.

Return type:

BucketEventHistoryCatalogue

Parameters: