cadrumo.application.invoices.catalogue_creation_ports module¶
Application-owned capabilities for catalogue-invoice creation.
The creation service needs three distinct authorities: a guarded invoice catalogue mutation, a guarded bucket-event append, and an exchange-rate source. This module owns the narrow contracts and the bucket-scoped bundle. Concrete encrypted repositories and outbound rate providers are composed outside the application layer.
- exception CatalogueInvoicePersistenceError(operation)[source]¶
Bases:
CadrumoErrorTranslated failure from the invoice or event persistence capability.
- Parameters:
operation (str)
- Return type:
None
- code¶
- exception CatalogueInvoiceRateError(operation)[source]¶
Bases:
CadrumoErrorTranslated failure from the catalogue invoice rate capability.
- Parameters:
operation (str)
- Return type:
None
- code¶
- class CatalogueInvoiceRepositoryPort(*args, **kwargs)[source]¶
Bases:
ProtocolGuarded invoice-catalogue mutation capability for one bucket.
- mutate(mutation)[source]¶
Apply
mutationas one revision-guarded catalogue write.Core types:
InvoiceCatalogue.- Return type:
- Parameters:
mutation (Callable[[InvoiceCatalogue], InvoiceCatalogue])
- class CatalogueInvoiceEventRepositoryPort(*args, **kwargs)[source]¶
Bases:
BucketEventHistoryRepositoryProtocol,ProtocolGuarded event-history capability for one bucket.
- append_guarded(appender, *, attempts=4)[source]¶
Append through the event catalogue’s revision guard.
- Return type:
- Parameters:
appender (Callable[[BucketEventHistoryCatalogue], BucketEventHistoryCatalogue])
attempts (int)
- class CatalogueInvoiceRateProviderPort(*args, **kwargs)[source]¶
Bases:
ProtocolExchange-rate capability used while constructing a catalogue invoice.
- class CatalogueCreationPorts(invoice_repository, event_repository, rate_provider)[source]¶
Bases:
objectRequired authorities for one bucket-scoped catalogue creation.
- Parameters:
invoice_repository (CatalogueInvoiceRepositoryPort)
event_repository (CatalogueInvoiceEventRepositoryPort)
rate_provider (CatalogueInvoiceRateProviderPort)
-
invoice_repository:
CatalogueInvoiceRepositoryPort¶
-
event_repository:
CatalogueInvoiceEventRepositoryPort¶
-
rate_provider:
CatalogueInvoiceRateProviderPort¶