cadrumo.application.review.models module

Strict pydantic v2 records for the unified review queue.

Each per-kind model wraps the source record verbatim alongside the unified queue fields (item_id, modelo, severity, summary, drill_command, since).

The ReviewItem discriminated union uses a single discriminator field (kind) to select the concrete model, and pydantic enforces that discriminator at validation time.

Concrete models:

InvoiceReviewRecord and LedgerReviewRecord are re-exported here from cadrumo.application.workflow.review_models, which owns them jointly with WorkflowEvent because WorkflowState embeds both review records as field types — a genuine mutual runtime dependency between application.review and application.workflow that the shared leaf module resolves.

class TransactionReviewItem(**data)[source]

Bases: _ReviewItemBase

One pending bank transaction wrapped for the review queue.

The pending states surfaced here are NOT_YET_PROCESSED, PROCESSED_UNCLASSIFIED, and FAILED_VALIDATION. Severity is derived per state by the transaction-source adapter.

Variables:
Parameters:

data (Any)

kind: Literal[ReviewItemKind.TRANSACTION]
source: Transaction
class InvoiceReviewItem(**data)[source]

Bases: _ReviewItemBase

One pending invoice (unmatched, disputed, or payment-pending).

Variables:
Parameters:

data (Any)

kind: Literal[ReviewItemKind.INVOICE]
source: Invoice
class FindingReviewItem(**data)[source]

Bases: _ReviewItemBase

One pending finding extracted from a filing draft.

source is None for the placeholder row emitted when a draft has no findings but is in a DRAFT or VALIDATED status. Otherwise it carries the verbatim domain.filing.schema.ModeloValidationFinding.

Variables:
  • kind – Literal discriminator pinned to ReviewItemKind.FINDING.

  • source – The underlying finding, or None for a status placeholder row.

  • draft_id – Identifier of the originating filing draft.

  • draft_path – On-disk path of the originating filing draft.

  • stale_reasons – Why an approval aged out, empty for every other row.

Parameters:

data (Any)

kind: Literal[ReviewItemKind.FINDING]
source: ModeloValidationFinding | None
draft_id: str
draft_path: str
stale_reasons: tuple[ModeloApprovalStaleReason, ...]

Which axes of the approval basis moved, as stable enum tokens.

Tokens rather than prose, because summary is a Translatable – an abstract catalogue key, not text – so a rendered explanation cannot be folded into it without producing a value no catalogue can translate. The projection that renders a row for an operator is where these become words.