aeat.application.modelo._m210_rate module

Modelo 210 IRNR treaty-rate resolution helpers.

The registry formula runtime computes the filing values and emits typed unresolved outcomes when a Modelo 210 rate cannot be applied directly. This application helper replays the same single tipo-de-gravamen resolution path over a RegistrySnapshot: it reads the m210-tipo-gravamen-2025 baseline table, consults the cross-cutting ConvenioAuthority treaty projection for the profile’s country_of_fiscal_residence, and returns either a scalar IRNR rate or blocking ModeloVerificationFinding records for deferred baseline coverage or missing treaty rows.

Base-dependent branches — the allocation_domestic_tariff pension delegation and the pension ceiling — return (None, []) because the live base-aware tariff path in the registry runtime remains the calculation authority; the sweep keeps the runtime-computed effective rate for those.

See also

aeat.domain.calculations.registry._formula_runtime

Formula-runtime implementation of irnr_resolve_tipo_gravamen and the typed M210 unresolved outcomes this application layer converts into findings.

aeat.application.modelo._verification_actions.verify_modelo_revision()

Verification path that replays this resolver for Modelo 210 observations.

aeat.application.calculations.tests.test_modelo_210_irnr_continuity

Cross-renta enrollment coverage for the registry-backed M210 engine.

resolve_m210_rate(profile, tipo_renta, year, snapshot)[source]

Resolve the M210 rate for (profile, tipo_renta, year).

The RegistrySnapshot supplies the m210-tipo-gravamen-2025 baseline table and the cross-cutting ConvenioAuthority; the TaxpayerProfile supplies country_of_fiscal_residence for treaty lookup. Returns (rate, findings) where findings contains blocking ModeloVerificationFinding records when a required rate is deferred or unavailable.

A profile with no treaty country uses the baseline table. A profile with a treaty country must match a treaty override for (country, tipo_renta) unless the override delegates back to the domestic tariff. The resolver returns no scalar rate for base-dependent branches because those depend on the actual base amount and are computed by the formula runtime.

Return type:

tuple[Decimal | None, list[ModeloVerificationFinding]]

Parameters: