aeat.domain.calculations.registry._schema_scalars module

Scalar and annotated value types for registry schema models.

NifString

Canonical Spanish tax-identifier string.

Used as the value type for casillas declaring data_type = “nif”, and by any cross-domain consumer (filing draft assembly, oracle replay, export layouts) that needs to validate a NIF, NIE, or CIF identifier independently of a casilla declaration.

alias of Annotated[str, BeforeValidator(func=_validate_nif_string, json_schema_input_type=PydanticUndefined)]

ModeloYear

Canonical fiscal-year integer for the registry boundary.

Mirrors the RegistrySnapshotRef.modelo_year bound so a casilla declaring data_type = "year" and the snapshot coordinate agree on the supported window. Consumers that need to validate a year value independently of a casilla declaration should type their field as ModeloYear.

alias of Annotated[int, BeforeValidator(func=_coerce_modelo_year, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=2000), Le(le=2099)])]

PeriodCode

Canonical filing-period code for the registry boundary.

Used as the value type for casillas declaring data_type = "period_code", and by any cross-domain consumer (snapshot coordinates, oracle replay, export layouts) that needs to validate a period token independently of a casilla declaration.

alias of Annotated[str, BeforeValidator(func=_validate_period_code, json_schema_input_type=PydanticUndefined)]

CountryCode

Two-character country code for the registry boundary.

Used as the value type for casillas declaring data_type = "country_code". Membership against the AEAT-supported country list is layered through per-casilla enum constraints (Plan B) and semantic-role consistency (Plan C); this alias enforces only the alpha-2 shape.

alias of Annotated[str, BeforeValidator(func=_validate_country_code, json_schema_input_type=PydanticUndefined)]

IbanString

Canonical IBAN string for the registry boundary.

Used as the value type for casillas declaring data_type = "iban" and by any cross-domain consumer that needs to validate an IBAN independently of a casilla declaration.

alias of Annotated[str, BeforeValidator(func=_validate_iban_string, json_schema_input_type=PydanticUndefined)]

PersonOrEntityName

Personal or entity name for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_name_string, json_schema_input_type=PydanticUndefined)]

NifIvaString

Intracomunitario NIF-IVA string for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_nif_iva_string, json_schema_input_type=PydanticUndefined)]

CCAACode

Autonomous-community code for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_ccaa_code, json_schema_input_type=PydanticUndefined)]

ProvinceCode

Two-digit Spanish province code for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_province_code, json_schema_input_type=PydanticUndefined)]

PostalCode

Five-digit Spanish postal code for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_postal_code, json_schema_input_type=PydanticUndefined)]

MunicipalityCode

Five-digit INE municipality code for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_municipality_code, json_schema_input_type=PydanticUndefined)]

BicString

SWIFT BIC for the registry boundary.

alias of Annotated[str, BeforeValidator(func=_validate_bic_string, json_schema_input_type=PydanticUndefined)]

CalendarDate

Calendar date string in ISO 8601 or AEAT ddmmaaaa form.

alias of Annotated[str, BeforeValidator(func=_validate_calendar_date, json_schema_input_type=PydanticUndefined)]

BindingSelectorValue

Closed union of the value shapes a raw binding-selector entry can hold.

alias of str | int | Annotated[Decimal, BeforeValidator(func=_coerce_decimal, json_schema_input_type=PydanticUndefined)] | bool | tuple[str, …]

BindingSelectorMap

Authoring/input mapping shape for binding selectors before family hydration.

Registry TOML and tests still supply selector payloads as ordinary dictionaries. DataBindingDefinition immediately hydrates that mapping through the per-source selector model registered in _bindings, so the stored binding field is no longer this broad map.

alias of dict[str, str | int | Annotated[Decimal, BeforeValidator(func=_coerce_decimal, json_schema_input_type=PydanticUndefined)] | bool | tuple[str, …]]

BindingSelector

Stored binding selector payload after source-family hydration.

The concrete value is one of the frozen per-source pydantic selector models registered by selector_model_for_source. SerializeAsAny preserves the concrete model’s fields during model_dump/model_dump_json instead of serialising through the empty BaseModel surface.

alias of Annotated[BaseModel, SerializeAsAny()]