cadrumo.application.inventory.ports module¶
Application-owned capabilities for bucket-scoped inventory operations.
The inventory service coordinates ledger persistence and bucket-event emission, but it does not know which encrypted repositories implement either capability. An executable composition root supplies this complete bundle for each bucket.
- class InventoryLedgerServiceRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolComplete ledger capability required by
InventoryService.- save(document)[source]¶
Persist a validated inventory document.
- Return type:
- Parameters:
document (InventoryLedgerDocument)
- create(ledger)[source]¶
Atomically create one activity/year ledger.
- Return type:
- Parameters:
ledger (InventoryLedger)
- record_closing_authority(actividad_id, authority_record, *, year)[source]¶
Atomically record one closing-authority record.
- Return type:
- Parameters:
actividad_id (str)
authority_record (InventoryClosingAuthorityRecord)
year (int)
- class InventoryServicePorts(inventory_repository_factory, bucket_event_repository)[source]¶
Bases:
objectRequired persisted authorities for one inventory service instance.
- Parameters:
inventory_repository_factory (Callable[[str], InventoryLedgerServiceRepositoryProtocol])
bucket_event_repository (BucketEventHistoryRepositoryProtocol)
-
inventory_repository_factory:
Callable[[str],InventoryLedgerServiceRepositoryProtocol]¶
-
bucket_event_repository:
BucketEventHistoryRepositoryProtocol¶