cadrumo.application.modelo.verification_cross_period module

Generic cross-period verification mechanics.

Revision coordinates, relation definitions, applicability, predicates, and provenance are selected from the validated registry. This module keeps the application boundary and does not reproduce declaration facts locally.

cross_period_expected_member_sets_from_profile(profile, explicit_member_sets=())[source]

Project profile rosters into the generic registry gate contract.

Core types: TaxpayerProfile.

Return type:

tuple[CrossPeriodExpectedMemberSet, ...]

Parameters:
registry_modality_finding(*, work_unit, profile)[source]

Leave model-specific modality findings to the selected registry.

Core types: TaxpayerProfile.

Return type:

ModeloVerificationFinding | None

Parameters:
cross_period_clean_state_verdict_for_work_unit(work_unit, *, observation_repository, filing_repository, calculation_repository, verification_repository, justificante_repository, expected_member_sets=(), taxpayer_tax_id=None, activity_start_date=None, modelo_202_modality=None, taxpayer_files_economic_activity=None, workflow_profile=None, not_applicable_source_modelos=None, zero_value_previous_filing_binding_ids=None, m111_no_retenciones_periods=None, operation=None)[source]

Evaluate the registry-declared cross-period dependencies of one work unit.

Returns None only when the work unit’s coordinate selects no registry revision; every selected revision is evaluated against the stored prior filings, observations, and justificantes. When the caller supplies no not_applicable_source_modelos but does supply workflow_profile, the revision’s economic-activity-conditional sources the profile positively excludes (Modelo 130 or 131, RIRPF art. 110) are scoped out.

Core types: TaxpayerProfile.

Return type:

CrossPeriodCleanStateVerdict | None

Parameters:
zero_value_previous_filing_binding_ids(target)[source]

Return zero-valued binding overrides for the selected revision.

Core types: CalculationRevision.

Return type:

frozenset[str]

Parameters:

target (CalculationRevision | None)

An IVA compensación carry is additionally governed by LIVA art. 99.

cross_period_clean_state_findings(verdict, *, iva_compensation_decision=None, activity_start_date=None, blocking_finding_observer=None)[source]

Return verification findings for a cross-period clean-state verdict.

Every unclean dependency yields a BLOCKING finding. Suppressions and non-official bases stay visible as NON-BLOCKING advisories. When an evidence-missing dependency blocks and the profile records no activity-start date, one more BLOCKING finding asks for the date, because the gate cannot otherwise tell a first filer from a genuinely missing prior filing.

Return type:

tuple[ModeloVerificationFinding, ...]

Parameters:
require_cross_period_clean_state(work_unit, *, observation_repository, filing_repository, calculation_repository, verification_repository, justificante_repository, iva_compensation_decision=None, expected_member_sets=(), taxpayer_tax_id=None, activity_start_date=None, modelo_202_modality=None, taxpayer_files_economic_activity=None, workflow_profile=None, target_revision=None, subject_leaf_key='modelo.work.verify', operation=None)[source]

Refuse the action while a registry-declared prior period is not cleanly evidenced.

Core types: CalculationRevision, TaxpayerProfile.

Return type:

None

Parameters: