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:
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
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:
_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
aeat.domain.transactions.Transaction.
- Parameters:
item_id (str)
modelo (str | None)
severity (ReviewSeverity)
summary (Translatable)
drill_command (str)
since (datetime)
kind (Literal[ReviewItemKind.TRANSACTION])
source (Transaction)
- 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
aeat.domain.invoices.Invoice.
- Parameters:
item_id (str)
modelo (str | None)
severity (ReviewSeverity)
summary (Translatable)
drill_command (str)
since (datetime)
kind (Literal[ReviewItemKind.INVOICE])
source (Invoice)
- 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 verbatimaeat.application.filing.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.
- Parameters:
item_id (str)
modelo (str | None)
severity (ReviewSeverity)
summary (Translatable)
drill_command (str)
since (datetime)
kind (Literal[ReviewItemKind.FINDING])
source (ModeloValidationFinding | None)
draft_id (str)
draft_path (str)
- 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
kindfield as the discriminator. Validate viaTypeAdapter(ReviewItem).validate_python(...)or.validate_json(...).alias of
Annotated[TransactionReviewItem|InvoiceReviewItem|FindingReviewItem, FieldInfo(annotation=NoneType, required=True, discriminator=’kind’)]