cadrumo.domain.contribuyente.family_types module¶
Typed personal/family profile records for Modelo 100 inputs.
The records in this module describe factual people and family-unit flags. They do not decide Modelo 100 legal treatment, minimum amounts, deduction eligibility, or casilla formulas; those remain registry-owned.
DescendantInfo, RentaDescendantProfile, and
RentaAscendantProfile feed RentaFamilyProfile, whose helper
methods derive Art. 58 minimum counts and Art. 81 maternity/guardería amounts
from the factual profile records.
- within_multi_year_applicability_window(entry_year, filing_year, *, following_periods)[source]¶
Return whether filing_year is inside a multi-year applicability window.
A reusable primitive for autonomic deducciones that apply in the period of a triggering event (a nacimiento, an adopción, a rehabilitación, …) plus a fixed number of following periods. The window is the closed interval
[entry_year, entry_year + following_periods];following_periods = 0yields a single-year window.
- months_of_year_between(start, end, filing_year)[source]¶
Months of filing_year inside the half-open
(year, month)span[start, end).Compares
(year, month)pairs rather than dates so a span anchored on a 29 February event resolves in a non-leap year, where constructing the anniversary date raises. Half-open by design: both Art. 81.1 windows count their opening month in full and exclude the month the span runs out.
- coerce_iso_date_field(value)[source]¶
Delegate for @field_validator date fields: parse ISO strings, pass through everything else.
- class MinimoDescendientesThresholds(**data)[source]¶
Bases:
BaseModelThe two Art. 58.1 / Art. 61 norma 2ª eligibility figures, per filing year.
Both are registry
moneyparameters the caller resolves for the filing year being computed; this domain layer performs no euro-figure lookup of its own (aeat-registry-authority-flow). Carrying them as one required argument rather than two optional ones is deliberate: an optional threshold would let a caller silently skip half the law and inflate the mínimo, which is the exact defect this record exists to close.Fields¶
- rentas_anuales_limite
Art. 58.1 LIRPF ceiling on the descendant’s own annual rentas excluding exempt income. Registry parameter
renta-{year}-minimo-descendientes-rentas-anuales-limite-{year}.- declaracion_propia_rentas_limite
Art. 61 norma 2ª LIRPF ceiling on the rentas in a descendant’s OWN return. Registry parameter
renta-{year}-minimo-descendientes-declaracion-propia-rentas-limite-{year}.
- rentas_anuales_limite: NonNegativeDecimal¶
- declaracion_propia_rentas_limite: NonNegativeDecimal¶
- Parameters:
data (Any)
- class GuarderiaMonthSpend(**data)[source]¶
Bases:
BaseModelOne month’s guardería spend for one descendant (Art. 81.2 LIRPF).
Month-granular because the statute is: the increase runs while the child is under three and, in the period the child TURNS three, extends to the spend “incurridos con posterioridad al cumplimiento de dicha edad” up to the month before the second cycle of infant education may begin. An annual total cannot express either boundary.
The map these build is SPARSE by construction — a month with no spend simply has no entry — so nothing here encodes a window. That is deliberate and is the whole reason the shape is monthly primaries rather than a pre-split figure: every split shape would bake a boundary into stored data, and the upper boundary is not this application’s to determine.
- Parameters:
data (Any)
- month: CalendarMonth¶
- amount_euros: NonNegativeInt¶