cadrumo.adapters.persistence.profile.catalogue_creation module¶
Outward adapters for the catalogue-invoice creation capability.
The application bundle exposes only domain catalogue values and application errors. These wrappers bind the existing encrypted repositories and ECB provider to that contract, translating storage/upstream failures before they reach an application caller.
- class CatalogueCreationInvoiceRepositoryAdapter(*, repository)[source]¶
Bases:
CatalogueInvoiceRepositoryPortTranslate the encrypted invoice repository to the creation port.
- Parameters:
repository (InvoiceCatalogueRepository)
- mutate(mutation)[source]¶
Apply one guarded mutation, preserving domain validation refusals.
Core types:
InvoiceCatalogue.- Return type:
- Parameters:
mutation (Callable[[InvoiceCatalogue], InvoiceCatalogue])
- class CatalogueCreationEventRepositoryAdapter(*, repository)[source]¶
Bases:
CatalogueInvoiceEventRepositoryPortTranslate the encrypted bucket-event repository to the creation port.
- Parameters:
repository (BucketEventHistoryRepository)
- save(catalogue)[source]¶
Persist event history through the existing encrypted repository.
- Return type:
- Parameters:
catalogue (BucketEventHistoryCatalogue)
- to_secure_object_write(catalogue, *, expected_revision_id=None)[source]¶
Prepare the inherited co-commit write capability.
- Return type:
- Parameters:
catalogue (BucketEventHistoryCatalogue)
expected_revision_id (str | None)
- append_guarded(appender, *, attempts=4)[source]¶
Append one event through the repository revision guard.
- Return type:
- Parameters:
appender (Callable[[BucketEventHistoryCatalogue], BucketEventHistoryCatalogue])
attempts (int)
- class CatalogueCreationRateProviderAdapter(*, provider)[source]¶
Bases:
CatalogueInvoiceRateProviderPortTranslate the host’s exchange-rate provider to the application rate capability.
- Parameters:
provider (ExchangeRateProvider)
- build_catalogue_creation_ports(*, bucket_id)[source]¶
Bind the existing encrypted repositories and the host’s rate provider for a bucket.
- Return type:
- Parameters:
bucket_id (str)