cadrumo.entrypoints.tui.ledger_doors module

Concrete Ledger workspace doors for an installed session: import, invoice entry, evidence.

Each door is a thin binding of one application service to the signed-in profile. The services own every rule – dedup, the invoice writer’s checks, evidence custody – so nothing here decides anything a CLI invocation of the same service would decide differently.

LEDGER_IMPORT_SOURCE_COMMAND: Final

The audit label an import written from this surface is recorded under.

class LedgerImportDoor(profile_id, operation)[source]

Bases: object

Preview and apply bank statements and invoice books for one profile.

Parameters:
profile_id: str
operation: PinnedAuthorityOperation
async preview(request)[source]

Read without writing, off the event loop: a parser import alone can take a second.

Return type:

LedgerImportOutcomeV1

Parameters:

request (LedgerImportRequestV1)

async apply(request)[source]

Write through the same services the CLI import verbs use, off the event loop.

Return type:

LedgerImportOutcomeV1

Parameters:

request (LedgerImportRequestV1)

ledger_invoice_add_door(profile_id, operation)[source]

Bind the sole catalogue-invoice writer to the signed-in profile.

Return type:

LedgerInvoiceAddDoorV1

Parameters:
class LedgerEvidenceDoor(profile_id, operation)[source]

Bases: object

The signed-in profile’s purchase-invoice documents and the reader that reads them.

Parameters:
profile_id: str
operation: PinnedAuthorityOperation
list_records()[source]

Read every registered document with its confirmation state.

Return type:

tuple[LedgerEvidenceRecordRowV1, ...]

async add(source_path)[source]

Register one document off the event loop; its bytes go to secure storage, never a path reference.

Return type:

LedgerEvidenceRecordRowV1

Parameters:

source_path (str)

async extract(evidence_id)[source]

Read one stored document on this machine, off the event loop; nothing is recorded.

Return type:

LedgerEvidenceDraftV1

Parameters:

evidence_id (str)

async confirm(confirmation)[source]

Re-read the document and record it as an invoice, off the event loop.

Return type:

LedgerEvidenceConfirmedV1

Parameters:

confirmation (LedgerEvidenceConfirmationV1)

reader_readiness()[source]

Ask the reader for its one readiness claim; nothing is started or loaded.

Return type:

LedgerReaderReadinessV1

ledger_workspace_refresh(profile_id, capture_ledger)[source]

Bind a re-read of the Ledger projection and the attachment queue to a fresh capture.

Return type:

Callable[[], LedgerWorkspaceRefreshV1]

Parameters: