cadrumo.application.wizard.descendant_group module¶
The descendant repeating group for the setup flow’s familia phase.
Descendant collection is a genuinely new wizard surface: the one-shot
WizardFlow catalogue carries no
repeating-group primitive, so the group is authored directly in the
substrate’s FlowRepeatingGroup
vocabulary and spliced into the bridged
FlowDefinition by
attach_descendant_group() – the same post-bridge decoration seam
as the format-hint and legal-validator attachers, so the substrate’s
one-way projection stays domain-blind.
A count question (DESCENDANTS_COUNT_PAGE_ID) gates the per-
descendant page family: the engine expands the group to that INTEGER
answer, so count = 0 hides every instance page and a positive count
exposes one page set per descendant. Instance answers key the canonical
answer map as descendientes#<index>.<page-id>; the commit path
projects them through
descendant_facts_from_answers()
into the exact renta_family.descendiente.{n}.* fact shape the
_minimo_descendientes_facts injector and the registry selectors
consume.
Every static wizard.setup.descendientes.* copy reference is declared as a
_LOCALE_KEY module constant so the locale scaffold’s static usage scanner
treats it as live. Relationship-choice labels are the one data-driven
exception: their locale key is projected from the registry-owned relationship
token, never maintained as a second Python catalogue.
- DESCENDANTS_GROUP_ID¶
Repeating-group id; instance answers key as
descendientes#<index>.<page>.
- DESCENDANTS_COUNT_PAGE_ID¶
Count-source page id; its INTEGER answer drives the instance count.
- DESCENDANT_PAGE_IDS: tuple[str, ...]¶
Per-descendant page ids in walk order (consumed by the fact projection).
- DESCENDANT_NIF_VALIDATOR_ID¶
Registered id of the per-answer descendant-NIF validator.
- DESCENDANT_MESES_VALIDATOR_ID¶
Registered id of the per-answer descendant meses-madre-trabajo range validator.
- DESCENDANT_ALTA_POSTERIOR_VALIDATOR_ID¶
Registered id of the post-birth Social Security completion-month validator.
- DESCENDANT_GASTOS_VALIDATOR_ID¶
Registered id of the per-answer descendant gastos-guardería sign validator.
- DESCENDANT_GASTOS_MENSUALES_VALIDATOR_ID¶
Registered id of the per-answer monthly-guardería grammar validator.
The map is ONE flattened page carrying a
MM:AMOUNTgrammar rather than a per-month sub-question, because a per-month group inside the per-descendant group is a NESTED repetition and this substrate has no primitive for it. The flattening is therefore a measured constraint, not a preference, and the grammar validator is what carries the structure the substrate cannot.
- DESCENDANT_GUARDERIA_SPEND_VALIDATOR_ID¶
Registered id of the flow-scope one-spend-authority-per-child guard.
Flow-scope rather than per-answer because the rule spans two pages of one instance: an annual total is only wrong in the presence of a monthly map on a sibling page, which a per-answer validator cannot see. It mirrors the canonical record’s own refusal so a scripted or resumed answer map cannot reach the persist path carrying both.
- DESCENDANT_RENTAS_VALIDATOR_ID¶
Registered id of the per-answer descendant rentas-anuales sign validator.
- DESCENDANT_ENTRY_EVENT_VALIDATOR_ID¶
Registered id of the flow-scope descendant entry-event cross-field validator.
Covers both Art. 58.2 anchors (the Registro Civil inscription and the acogimiento resolución) and their coherence against the declared relación. One validator rather than two because the rules are not independent: which date a record may carry is decided by the relación, so splitting them would leave each half checking a condition the other half owns.
- build_descendant_count_page(operation)[source]¶
Build the count page under the caller-owned authority operation.
- Return type:
- Parameters:
operation (PinnedAuthorityOperation)
- build_descendant_group(operation)[source]¶
Build the relationship-aware descendant group under a pinned operation.
- Return type:
- Parameters:
operation (PinnedAuthorityOperation)
- attach_descendant_group(definition, *, operation)[source]¶
Return
definitionwith the descendant count page and group in familia.Appends the count-source page and the repeating group to the familia section, in that order, so the substrate’s count-source validator sees the INTEGER count page before the group that names it, and names the flow-scope entry-event cross-field validator on the definition so a bad entry date – or one the declared relación cannot carry – blocks submit. Raises when the familia section is absent – a silent no-op would drop the whole descendant surface. Idempotent on the flow validator id: re-applying does not duplicate it.
- Return type:
- Parameters:
definition (FlowDefinition)
operation (PinnedAuthorityOperation)