"""Domain-level repository Protocol for the bucket-event-history catalogue.Application-layer code that persists or loads bucket event cataloguesdepends on :class:`BucketEventHistoryRepositoryProtocol`, not on the concretesecure-object-backed :class:`BucketEventHistoryRepository`. This keeps callerstyped against the narrow port while the concrete repository owns the adapterintegration.:class:`BucketEventHistoryRepositoryProtocol` abstracts ``exists`` / ``load`` /``save`` operations over :class:`BucketEventHistoryCatalogue`, allowingservices to emit :class:`BucketEvent` history without importing the concrete:class:`BucketEventHistoryRepository`."""from__future__importannotationsfromtypingimportProtocol,runtime_checkablefrom._eventimportBucketEventHistoryCatalogue
[docs]@runtime_checkableclassBucketEventHistoryRepositoryProtocol(Protocol):"""Narrow domain-facing repository contract for the bucket-event-history catalogue. Any object that provides ``exists``, ``load``, and ``save`` over a per-bucket :class:`BucketEventHistoryCatalogue` satisfies this protocol. The production implementation is :class:`BucketEventHistoryRepository`. """
[docs]defexists(self)->bool:"""Return whether an event-history catalogue has been persisted."""...
[docs]defload(self)->BucketEventHistoryCatalogue:"""Return the persisted catalogue or an empty catalogue if absent. Returns: The :class:`BucketEventHistoryCatalogue` loaded from storage. """...
[docs]defsave(self,catalogue:BucketEventHistoryCatalogue)->None:"""Persist ``catalogue`` in the encrypted database object store. Args: catalogue: The :class:`BucketEventHistoryCatalogue` to persist. """...