cadrumo.application.wizard.setup_legal_validators module¶
Art. 82 LIRPF unidad-familiar validator for the interactive setup flow.
Art. 82.1 LIRPF defines the two unidad-familiar modalities eligible for tributación conjunta (joint taxation):
Modalidad 1ª (Art. 82.1.1ª): the married couple not legally separated, together with their minor or judicially-incapacitated children if any. Children are optional — a childless married couple may still opt for conjunta as a couple.
Modalidad 2ª (Art. 82.1.2ª): in cases of legal separation, or where no marriage bond exists, the single parent and all the cohabiting children who meet the modalidad-1ª requirements — the monoparental unit. This modality requires qualifying children: no unidad familiar forms without them, and the absence of a marriage bond is registration-agnostic (a de-facto couple, registered or not, has no marriage bond).
The single flow validator this module registers enforces the modalidad-2ª
children requirement at familia section exit. A joint declaration whose
family situation is a non-married modality resolved by the typed
situacion_familiar_monoparental_required projection
and which declares no minor children in the unit cannot form a valid unidad
familiar, so it fails and blocks forward navigation with a typed verdict. A
married declaration (modalidad 1ª) and a monoparental declaration that does
carry children both pass. The verdict carries a catalogue key and redacted
context only — the raw answers never enter the diagnostic.
- SETUP_UNIDAD_FAMILIAR_VALIDATOR_ID¶
Registered id of the familia section-exit Art. 82.1.2ª validator.
- validate_unidad_familiar_conjunta(answers)[source]¶
Enforce the Art. 82.1.2ª monoparental children requirement.
A joint declaration (
taxation-type== JOINT) whosesituacion-familiaris a non-married modality forms a valid unidad familiar only as a monoparental unit, which Art. 82.1.2ª conditions on qualifying children. When no minor children are declared in the unit the verdict fails; a married (modalidad 1ª) or a child-bearing monoparental declaration passes.family-minor-children-in-unitis the sole qualifying-children proxy the setup flow models. Art. 82.1.1ª(b) also admits adult judicially incapacitated children under prorogated patria potestad into the unit, but the flow collects no field for that case and the registry’s conjunta reduction keys on the same minor-children signal, so the hard refusal is exact within the declared data model. Modelling the incapacitated-adult axis later requires widening this predicate and the registry signal together, not relaxing this gate alone.
- attach_setup_legal_validators(definition)[source]¶
Return
definitionwith the familia section carrying the Art. 82 exit validator.The setup flow projects from the one-shot catalogue (which declares no validator ids), so this decorator names the registered validator on the
familiaFlowSection’sexit_validator_ids— mirroring howattach_format_hints()decorates the projected definition. Idempotent: a definition already carrying the id passes through untouched.- Return type:
- Parameters:
definition (FlowDefinition)