Source code for cadrumo.application.bienes_inversion.ports
"""Application-owned capabilities for the capital-goods IVA register.The register service and calculation/advisory paths consume this contract ratherthan constructing the encrypted persistence adapter. An executable compositionroot binds one bucket-scoped implementation and supplies it explicitly to eachapplication path."""from__future__importannotationsfromtypingimportProtocolfrom...domain.bienes_inversion.registerimportBienesInversionIvaRegister,BienInversionIvaRecord
[docs]classBienesInversionIvaRegisterRepositoryProtocol(Protocol):"""Required bucket-bound read/write capability for capital-goods register state."""
[docs]defload(self)->BienesInversionIvaRegister:"""Load the register, returning an empty register when no state exists."""...
[docs]defadd(self,record:BienInversionIvaRecord)->BienesInversionIvaRegister:"""Atomically add one record and return the updated register."""...
[docs]classBienesInversionIvaRegisterRepositoryFactory(Protocol):"""Construct the register capability bound to one profile bucket."""def__call__(self,*,bucket_id:str)->BienesInversionIvaRegisterRepositoryProtocol:"""Return the required register capability for ``bucket_id``."""...