cadrumo.domain.contribuyente.tax_residence module

Where a taxpayer is tax-resident, and how that has changed.

These models and the region parser were defined directly in the package namespace, which is why deleting an export map could not make it inert. They live in a module of their own now.

class ResidenceChange(**data)[source]

Bases: BaseModel

One historic tax-residence transition.

Parameters:
  • from_ccaa (CCAA | None)

  • to_ccaa (CCAA)

  • effective_from (date)

  • reason (str | None)

from_ccaa: CCAA | None
to_ccaa: CCAA
effective_from: date
reason: str | None
class TaxResidenceProfile(**data)[source]

Bases: BaseModel

The operator’s current ordinary CCAA tax residence for RENTA.

Parameters:
  • schema_version (Annotated[str, AfterValidator(func=~cadrumo.domain.contribuyente.constants._require_supported_profile_schema_version)])

  • ccaa (CCAA)

  • tax_residence_since (date | None)

  • tax_residence_change_history (tuple[ResidenceChange, ...])

schema_version: ProfileSchemaVersion
ccaa: CCAA
tax_residence_since: date | None
tax_residence_change_history: tuple[ResidenceChange, ...]
parse_tax_region(raw)[source]

Parse a CLI/user tax-region token through the dated CCAA catalogue.

Return type:

CCAA

Parameters:

raw (str)