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:
TransactionReviewItem— pending bank transactions.InvoiceReviewItem— unmatched, disputed, or payment-pending invoices.FindingReviewItem— pending findings on filing drafts.
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:
_ReviewItemBaseOne pending bank transaction wrapped for the review queue.
The pending states surfaced here are
NOT_YET_PROCESSED,PROCESSED_UNCLASSIFIED, andFAILED_VALIDATION. Severity is derived per state by the transaction-source adapter.- Variables:
kind – Literal discriminator pinned to
ReviewItemKind.TRANSACTION.source – The verbatim
cadrumo.domain.transactions.models.Transaction.
- Parameters:
data (Any)
- kind: Literal[ReviewItemKind.TRANSACTION]¶
- source: Transaction¶
- class InvoiceReviewItem(**data)[source]¶
Bases:
_ReviewItemBaseOne pending invoice (unmatched, disputed, or payment-pending).
- Variables:
kind – Literal discriminator pinned to
ReviewItemKind.INVOICE.source – The verbatim
cadrumo.domain.invoices.models.Invoice.
- Parameters:
data (Any)
- kind: Literal[ReviewItemKind.INVOICE]¶
- source: Invoice¶
- class FindingReviewItem(**data)[source]¶
Bases:
_ReviewItemBaseOne pending finding extracted from a filing draft.
sourceisNonefor the placeholder row emitted when a draft has no findings but is in a DRAFT or VALIDATED status. Otherwise it carries the verbatimdomain.filing.schema.ModeloValidationFinding.- Variables:
kind – Literal discriminator pinned to
ReviewItemKind.FINDING.source – The underlying finding, or
Nonefor 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
summaryis aTranslatable– 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.