cadrumo.domain.contribuyente.renta_codes module¶
AEAT Renta profile-code types and stable export projections.
The closed profile vocabularies remain here where they are form-owned. The cross-cutting fiscal-residency vocabulary is an opaque token projected from the governed facts registry, so CLI and wizard surfaces obtain its choices through the registry resolver rather than maintaining a second catalogue.
RentaSexCode, RentaMaritalStatus, and
RentaDisabilityGrade back Modelo 100
profile bindings; SituacionFamiliar and
SituacionFamiliarM145 keep the Art. 82 LIRPF joint-taxation axis
separate from Modelo 145 withholding categories.
- class RentaMaritalStatus(*values)[source]¶
Bases:
StrEnumRenta taxpayer marital / registered-partnership profile values.
- SOLTERO¶
- CASADO¶
- VIUDO¶
- SEPARADO_DIVORCIADO¶
- PAREJA_HECHO¶
- RENTA_MODELO100_ECIVIL_EXPORT_CODES: frozenset[str]¶
Official Modelo 100 ECIVIL export codes accepted by the bundled XSD.
- modelo100_ecivil_export_code(value)[source]¶
Return a validated official Modelo 100 ECIVIL export code.
RentaMaritalStatus.PAREJA_HECHOis intentionally profile-only. The official Modelo 100 ECIVIL field is restricted to Estado Civil codes 1-4, so callers must supply the taxpayer’s true official civil-status code instead of exporting the registered-partnership profile marker.
- renta_modelo100_ccaa_codigos()[source]¶
Return the official Modelo 100 CCAA códigos accepted by the bundled XSD.
Keyed lazily rather than at module scope because
CCAAmembers are projected from the governed facts registry: naming one resolves the catalogue, and resolving it while this module is being imported reaches the registry authority through an import cycle. The códigos themselves are the form’s own datum and stay here.
- modelo100_ccaa_codigo(value)[source]¶
Return the official Modelo 100 código for an autonomous community.
- Parameters:
value (
CCAA|str) – The community to look up, as aCCAAmember or its canonical lowercase token ("madrid"). Any other string is a community this export cannot name, and is refused rather than resolved.- Return type:
- Returns:
The two-digit código AEAT’s Modelo 100 schema accepts for
value.- Raises:
ValueError – when
valuenames no community that carries a Modelo 100 código. Refusing is deliberate: a community exported under the wrong código produces a declaration that validates against the AEAT schema while naming the wrong comunidad, so an absent código must fail the export rather than fall back to a default.
- class RentaDisabilityGrade(*values)[source]¶
Bases:
StrEnumModelo 100
tipo_GradoDiscapacidadvalues.- GE_33_LT_65¶
- GE_65¶
- JUDICIAL_INCAPACITY¶
- ASSISTANCE_OR_REDUCED_MOBILITY¶
- class FiscalResidency(value, *, _registry_validated=False)[source]¶
Bases:
StrictRegistryTokenOpaque fiscal-residency token projected from the facts registry.
The registry owns residency membership and its downstream regime meaning. This type retains only the stable wire-token shape; callers obtain values through the typed residency catalogue resolver.
- class SituacionFamiliar(value, *, _registry_validated=False)[source]¶
Bases:
StrictRegistryTokenOpaque Art. 82 family-situation token projected from the facts registry.
The registry owns the five-token vocabulary and the joint-taxation eligibility mapping. This type retains only the stable wire-token shape; callers obtain a value through the typed registry projection.
- class SituacionFamiliarM145(value, *, _registry_validated=False)[source]¶
Bases:
StrictRegistryTokenOpaque Modelo 145 family-situation token projected from the facts registry.
Fact 0142 owns the three form values, their legal descriptions, and the supplementary-reduction eligibility mapping. This type retains only the stable wire-token shape; callers obtain values through the typed registry projection in
situacion_familiar_m145_catalogue.