aeat.application.modelo._verification_actions module

Verification actions and predicates for modelo filings.

verify_modelo_revision() evaluates a draft CalculationRevision against its RegistrySnapshot, workflow TaxpayerProfile, ledger diagnostics, registry verification predicates, and cross-period clean-state verdicts before persisting a VerificationReport.

Verification findings are the operator-facing gate vocabulary. BLOCKING-severity findings refuse the verified-complete transition; WARNING-severity ADVISORY findings remain visible in the report without bricking verify, file, or export. Calculate-path source diagnostics are separate CalculationSourceDiagnostic advisories; this module converts only verify-time registry, profile, provenance, and cross-period facts into ModeloVerificationFinding records.

Verification emits bucket-history entries through BucketEventHistoryRepository, stores casilla-level CasillaObservation provenance, and uses TransactionCatalogueRepository only for evidence advisories over source transactions.

See also

evaluate_cross_period_clean_state():

Shared cross-period gate used by verify, file, and export.

_calculation_diagnostics:

Calculate-path diagnostics that feed advisory observations before verify.

modelos:

Finding kind, severity, and completeness-status authority.

verify_modelo_revision(calculation_revision_id, *, actor, workflow_profile, work_unit_repository=None, calculation_repository=None, filing_repository=None, transaction_repository=None, verification_repository=None, bucket_event_repository=None, iva_compensation_decision_repository=None, calculation_observation_repository=None, participation_index_repository=None, cross_period_expected_member_sets=(), workflow_engine=None, workflow_runs_dir=None, settings=None, clock=None)[source]

Evaluate a draft revision against registry, clean-state, provenance, and workflow gates.

The verifier loads the draft CalculationRevision, resolves its work unit and RegistrySnapshot, builds verify-time findings, classifies the outcome, persists a VerificationReport, records bucket history, and updates the CalculationRevision only when the verified-complete transition is granted.

The supplied TaxpayerProfile scopes deadline/applicability decisions, while TransactionCatalogueRepository supplies non-blocking transaction-evidence advisories for source rows attached to the revision. WARNING-severity advisories remain report content; only BLOCKING severity can refuse the transition.

Parameters:
Return type:

VerificationReport

Returns:

The persisted VerificationReport.

Raises:
missing_required_casilla_finding(casilla_id, work_unit_id, *, casilla_def=None)
Return type:

ModeloVerificationFinding

Parameters:
iva_wallet_blocking_verification_finding(decision)
Return type:

ModeloVerificationFinding

Parameters:

decision (IvaCompensationReconciliationDecision)