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:
objectPreview and apply bank statements and invoice books for one profile.
- Parameters:
profile_id (str)
operation (PinnedAuthorityOperation)
-
operation:
PinnedAuthorityOperation¶
- async preview(request)[source]¶
Read without writing, off the event loop: a parser import alone can take a second.
- Return type:
- Parameters:
request (LedgerImportRequestV1)
- async apply(request)[source]¶
Write through the same services the CLI import verbs use, off the event loop.
- Return type:
- Parameters:
request (LedgerImportRequestV1)
- ledger_invoice_add_door(profile_id, operation)[source]¶
Bind the sole catalogue-invoice writer to the signed-in profile.
- Return type:
- Parameters:
profile_id (str)
operation (PinnedAuthorityOperation)
- class LedgerEvidenceDoor(profile_id, operation)[source]¶
Bases:
objectThe signed-in profile’s purchase-invoice documents and the reader that reads them.
- Parameters:
profile_id (str)
operation (PinnedAuthorityOperation)
-
operation:
PinnedAuthorityOperation¶
- async add(source_path)[source]¶
Register one document off the event loop; its bytes go to secure storage, never a path reference.
- Return type:
- 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:
- Parameters:
evidence_id (str)
- async confirm(confirmation)[source]¶
Re-read the document and record it as an invoice, off the event loop.
- Return type:
- Parameters:
confirmation (LedgerEvidenceConfirmationV1)
- 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:
- Parameters:
profile_id (str)
capture_ledger (Callable[[], LedgerWorkspaceProjectionV1])