Source code for cadrumo.application.prorrata_register.ports
"""Application-owned persistence capability for the prorrata register.The prorrata register service needs the register's complete mutation surface,while calculation paths only need its read and secure-write capabilities. Thisprotocol extends the domain read/write contract with the three atomic mutationverbs used by the application service, keeping both application consumersindependent from the encrypted-storage adapter."""from__future__importannotationsfromtypingimportProtocolfrom...domain.prorrata_register.protocolsimportProrrataRegisterRepositoryProtocolfrom...domain.prorrata_register.registerimport(ProrrataActivityRow,ProrrataRegister,ProrrataRegisterEntry,SectorDefinition,)
[docs]classProrrataRegisterServiceRepositoryProtocol(ProrrataRegisterRepositoryProtocol,Protocol):"""Complete bucket-bound register capability required by application services."""
[docs]defupsert_entry(self,entry:ProrrataRegisterEntry)->ProrrataRegister:"""Atomically add or replace one exercise/sector entry."""...
[docs]defupsert_sector_definition(self,definition:SectorDefinition)->ProrrataRegister:"""Atomically add or replace one differentiated-sector definition."""...
[docs]defupsert_activity_row(self,row:ProrrataActivityRow)->ProrrataRegister:"""Atomically add or replace one activity row."""...
[docs]classProrrataRegisterRepositoryFactory(Protocol):"""Construct the bucket-bound register capability for one profile."""def__call__(self,*,bucket_id:str)->ProrrataRegisterServiceRepositoryProtocol:"""Return the required repository for ``bucket_id``."""...