cadrumo.domain.calculations.registry.binding_targets module

Canonical target relationships for registry data bindings.

Binding declarations name the factual source that can populate a casilla. This module owns both directions of that relationship so registry consumers do not reconstruct the BOUND predicate independently.

bound_casilla_binding_ids(casilla)[source]

Return primary plus reviewed equivalent bindings for one bound casilla.

Return type:

tuple[TypeAliasType, ...]

Parameters:

casilla (CasillaDefinition)

casillas_by_binding(revision)[source]

Return every binding id mapped to its declaration-ordered target casillas.

Core types: ModeloRevision.

Return type:

Mapping[TypeAliasType, tuple[TypeAliasType, ...]]

Parameters:

revision (ModeloRevision)

class BindingConsumerKind(*values)[source]

Bases: StrEnum

The typed consumer surfaces that can name a binding in one revision.

CASILLA_PRIMARY

A BOUND casilla names the binding as its primary source.

CASILLA_ALTERNATE

A BOUND casilla names the binding as a reviewed equivalent.

FORMULA_OPERAND

A formula expression reads the binding through a binding leaf.

FORMULA_DATE_OPERAND

A formula expression reads the binding through a date_binding leaf.

EXPORT_FIELD

An export field renders the binding value directly.

EXPORT_BINDING_RECORD

An export record materialises its rows from the binding’s export selector.

class BindingConsumerRef(kind, owner)[source]

Bases: object

One typed consumer of a binding, named by surface and owning identifier.

Parameters:
kind: BindingConsumerKind
owner: str
binding_consumers(revision)[source]

Return every declared binding mapped to its typed consumers in one revision.

The reverse of the forward references the compiler already closes: a binding is referenced when a bound casilla, a formula operand, an export field or record. Bindings with no entry at all are returned as an empty tuple rather than omitted, so an orphan is a value in the mapping rather than a missing key a caller has to infer.

Core types: ModeloRevision.

Return type:

Mapping[TypeAliasType, tuple[BindingConsumerRef, ...]]

Parameters:

revision (ModeloRevision)