aeat.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 aeat.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:
kind: Literal[ReviewItemKind.TRANSACTION]
source: Transaction
class InvoiceReviewItem(**data)[source]

Bases: _ReviewItemBase

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

Variables:
Parameters:
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 aeat.application.filing.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.

Parameters:
kind: Literal[ReviewItemKind.FINDING]
source: ModeloValidationFinding | None
draft_id: str
draft_path: str
ReviewItem

Discriminated union of every concrete review-queue item.

Pydantic dispatches to the correct concrete model using the kind field as the discriminator. Validate via TypeAdapter(ReviewItem).validate_python(...) or .validate_json(...).

alias of Annotated[TransactionReviewItem | InvoiceReviewItem | FindingReviewItem, FieldInfo(annotation=NoneType, required=True, discriminator=’kind’)]