cadrumo.application.ledger.counterparty_establishment_ports module

Application-owned persistence capability for counterparty facts.

The establishment policy owns the fact DTO and its conflict/resolution rules. Encrypted storage is supplied by an outer composition root through this narrow protocol; storage-specific failures are translated by the adapter.

exception CounterpartyEstablishmentPersistenceError(operation)[source]

Bases: CadrumoError

Translated failure from the counterparty-establishment store.

Parameters:

operation (str)

Return type:

None

code
class CounterpartyEstablishmentRepositoryProtocol(*args, **kwargs)[source]

Bases: Protocol

Required bucket-bound operations for remembered counterparty facts.

load(identifier)[source]

Load one remembered fact, or return None when absent.

Return type:

ConfirmedCounterpartyFacts | None

Parameters:

identifier (str)

save(payload)[source]

Persist one validated remembered fact.

Return type:

None

Parameters:

payload (ConfirmedCounterpartyFacts)

delete(identifier)[source]

Delete one remembered fact and report whether it existed.

Return type:

bool

Parameters:

identifier (str)

class CounterpartyEstablishmentRepositoryFactory(*args, **kwargs)[source]

Bases: Protocol

Construct the persistence capability for one profile bucket.