cadrumo.domain.calculations.registry.relation_prefill_bindings module

The relation-prefill provider: one cross-filing fold declared in one place.

A relation_prefill binding folds values filed on another modelo – or on an earlier period of this one – into a form slot of the target filing. The declaration carries every axis of that fold: which modelo and casilla are read, what kind of dependency it is, and, through the shared closed temporal member, when the source was filed relative to the target.

class RelationPrefillProvider(**data)[source]

Bases: BaseModel

Strict validator for a relation_prefill binding declaration.

The fold used to be split across two identified families: a binding that named the slot and a relation that named the source, the periods, the year alignment, and the aggregation. Every axis except relation_kind and dependency_role was declared on both sides, and the two could disagree. They are one declaration now.

temporal is the shared closed member, so the source window is stated relative to the target filing context. An absolute source year is unspellable rather than merely rejected: no member of the union carries one, which is what keeps an inherited row from silently naming a year its successor edition does not file.

Aggregation stays on the binding: it is a property of the value channel the slot yields, not of the source coordinate this provider names.

Parameters:

data (Any)

kind: Literal[BindingSourceKind.RELATION_PREFILL]
relation_kind: RelationKindField
dependency_role: RelationDependencyRoleField
source_modelo: ModeloId
temporal: BindingTemporalSelector
source_casilla_id: CasillaId | None
source_casilla_ids: tuple[CasillaId, ...]
property max_year_delta: int | None

Return the absolute bound on anchor year deltas the member declares.

required_period_anchors_for_target(target_period)[source]

Return source year-offset and period anchors for a target period.

Each year offset is the TOTAL distance from the target filing year. An empty result means this provider names no source window for the target period at all, which is a scope-out and never a zero.

Return type:

tuple[tuple[int, str], ...]

Parameters:

target_period (str)

property required_source_periods: tuple[str, ...]

Return the fixed source periods the temporal member names, if any.

The members whose periods depend on the target period name none here; their windows come from required_period_anchors_for_target().

property declared_source_casilla_ids: tuple[CasillaId, ...]

Return the source casillas this provider reads, however they were declared.