cadrumo.domain.calculations.registry.binding_provider module¶
The closed union of value providers a binding declaration may name.
A binding says where a form slot’s value comes from. That “where” used to be a
pair: an open source token beside an untyped selector mapping, hydrated
into a per-family model by a lookup dict and re-validated by a second one. The
pair could disagree, the serialised form carried no tag, and every consumer
re-derived the member it was holding.
BindingProvider replaces the pair with one discriminated union. Each
member is the family’s own selector model, now carrying the kind literal
that used to live in the sibling source field, so the declaration is
self-describing: it validates to exactly one member, serialises with its own
tag, and reads back to the same member without a second field to consult.
Membership is the authored set. BindingSourceKind
carries two mesh-only members – borrador and iva_wallet_decision –
which name runtime value routes that no registry row may declare; they are
absent here, which is what makes “not a registry binding source” a type error
rather than a hand-written refusal.
The five invoice-family members share InvoiceProviderBase
rather than collapsing into one member: a union member carries exactly one
kind, and the direction a row declares (payable, collectible, the combined
M347 third-party total) is the fact its resolver and its clave classification
turn on.