cadrumo.domain.calculations.registry.profile_bindings module

The profile provider: a binding that reads the taxpayer’s own censo record.

A profile binding names a field of the taxpayer profile substrate (declarante, conyuge, hijos, ascendientes, …) rather than a filed value or a ledger fold. The three shapes it admits – a scalar key, a composite projection of several keys through a format renderer, and a field of a typed profile model – are mutually exclusive by validation, because a declaration that named two of them would leave the value’s origin ambiguous.

class ProfileProvider(**data)[source]

Bases: BaseModel

Strict validator for the selector mapping of a profile-source binding.

Profile-source bindings read values from the taxpayer profile substrate (declarante, conyuge, hijos, ascendientes, …). They land on the fichero-BOE record either as a typed scalar (single profile_key) or via a composite projection (profile_keys with a format rendering function), and optionally as a sub-collection field of a typed profile model (profile_model + collection + field).

Two cross-cutting fields apply to every shape:

  • xsd_path / xsd_attribute / dictionary_field: how the value is addressed on the on-wire record.

  • required_when_profile_key / required_when_value: a conditional applicability gate; only certain profile shapes set these.

Parameters:

data (Any)

kind: Literal[BindingSourceKind.PROFILE]
profile_key: str | None
profile_keys: tuple[str, ...]
profile_model: str | None
collection: str | None
field: str | None
repeating: bool
xsd_path: str | None
xsd_attribute: str | None
dictionary_field: str | None
format: str | None
required_when_profile_key: str | None
required_when_value: str | None