aeat.domain.buckets._protocols module

Domain-level repository Protocol for the bucket-event-history catalogue.

Application-layer code that persists or loads bucket event catalogues depends on BucketEventHistoryRepositoryProtocol, not on the concrete secure-object-backed BucketEventHistoryRepository. This keeps callers typed against the narrow port while the concrete repository owns the adapter integration.

BucketEventHistoryRepositoryProtocol abstracts exists / load / save operations over BucketEventHistoryCatalogue, allowing services to emit BucketEvent history without importing the concrete BucketEventHistoryRepository.

class BucketEventHistoryRepositoryProtocol(*args, **kwargs)[source]

Bases: Protocol

Narrow domain-facing repository contract for the bucket-event-history catalogue.

Any object that provides exists, load, and save over a per-bucket BucketEventHistoryCatalogue satisfies this protocol. The production implementation is BucketEventHistoryRepository.

exists()[source]

Return whether an event-history catalogue has been persisted.

Return type:

bool

load()[source]

Return the persisted catalogue or an empty catalogue if absent.

Return type:

BucketEventHistoryCatalogue

Returns:

The BucketEventHistoryCatalogue loaded from storage.

save(catalogue)[source]

Persist catalogue in the encrypted database object store.

Parameters:

catalogue (BucketEventHistoryCatalogue) – The BucketEventHistoryCatalogue to persist.

Return type:

None