cadrumo.application.ledger.preconditions module

Typed refusal outcomes owned by the ledger application boundary.

class LedgerPreconditionCondition(*values)[source]

Bases: StrEnum

Closed failed-condition identities for evidence and ledger refusals.

CONFIRMATION_BLOCKERS_RESOLVED
EVIDENCE_ATTACHMENT_SELECTION_VALID
EVIDENCE_BYTES_READABLE
EVIDENCE_COUNTERPARTY_VALID
EVIDENCE_DOCUMENT_BYTES_AVAILABLE
EVIDENCE_FILE_EXTENSION_SUPPORTED
EVIDENCE_FILE_READABLE
EVIDENCE_IDEMPOTENCY_KEY_UNIQUE
EVIDENCE_INVOICE_DATE_AVAILABLE
EVIDENCE_REQUIRED_FIELD_AVAILABLE
EVIDENCE_REFERENCE_RESOLVES
EVIDENCE_READER_AVAILABLE
EVIDENCE_TEXT_LAYER_AVAILABLE
EVIDENCE_VISION_CAPABILITY_ENABLED
EVIDENCE_XML_INVOICE_SUPPORTED
FILER_POSTCODE_VALID
COUNTERPARTY_IDENTIFIER_VALID
class LedgerPreconditionErrorMixin(message=None, *, context=None, translated_message=None, precondition_verdict=None)[source]

Bases: object

Attach one typed terminal refusal to an existing registered error.

Parameters:
property terminal_precondition_verdict: PreconditionVerdict | None

Return the exact application-owned refusal for later projection.

ledger_no_recovery_verdict(condition, *, facts, outcome=NoRecoveryOutcome.OPERATOR_DECISION)[source]

Return the exact ledger fact and explicit absence of a bound recovery.

Ledger services can identify their failed condition but cannot derive a safe executable action from those facts. Keeping the result typed makes that boundary explicit without retaining a copy-paste command string.

Return type:

PreconditionVerdict

Parameters: