cadrumo.domain.prorrata_register.protocols module¶
Domain-level repository Protocol for the cross-period IVA prorrata register.
Application-layer code that persists or loads the ProrrataRegister
depends on ProrrataRegisterRepositoryProtocol, not on the concrete
adapter-backed ProrrataRegisterRepository. This keeps the domain layer
free of adapter imports while still providing a typed port surface.
- class ProrrataRegisterRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the prorrata register.
Any object that provides its readable bucket identity together with
loadandto_secure_object_writeover the singletonProrrataRegistersatisfies this protocol. The concrete secure-object-backed implementation isProrrataRegisterRepository.- property bucket_id: str | None¶
Return the profile bucket id when the repository is explicitly bound to one.
- load()[source]¶
Return the persisted register or an empty register if absent.
- Return type:
- Returns:
The
ProrrataRegisterloaded from storage.
- load_revisioned()[source]¶
Return the register together with its current persistence revision.
- Return type:
- to_secure_object_write(register, *, expected_revision_id=None)[source]¶
Return the guarded
SecureObjectWriteforregisterwithout committing it.expected_revision_idmust be the revision returned byload_revisioned()whenever the singleton register was rebuilt from a read.- Return type:
- Parameters:
register (ProrrataRegister)
expected_revision_id (str | None)