Source code for cadrumo.domain.calculations.registry.tax_id_runtime
"""Authority-aware runtime operations for Spanish tax identifiers."""from__future__importannotationsfromdatetimeimportdatefrom....core.identity.documentsimportIdentityDocumentfrom....core.identity.documentsimportnif_check_letteras_nif_check_letterfrom....core.identity.documentsimportvalidate_identityas_validate_identityfrom....core.identity.tax_idimportvalidate_spanish_tax_idas_validate_spanish_tax_idfrom.tax_id_formatimportruntime_tax_id_format
[docs]defvalidate_runtime_spanish_tax_id(value:str,*,effective_date:date|None=None)->str:"""Validate one identifier through the established bundled authority."""return_validate_spanish_tax_id(value,runtime_tax_id_format(effective_date=effective_date))
[docs]defvalidate_runtime_identity(candidate:object,*,effective_date:date|None=None)->IdentityDocument:"""Classify one identifier through the established bundled authority."""return_validate_identity(candidate,runtime_tax_id_format(effective_date=effective_date))
[docs]defruntime_nif_check_letter(number:int,*,effective_date:date|None=None)->str:"""Compute one check letter through the established bundled authority."""return_nif_check_letter(number,runtime_tax_id_format(effective_date=effective_date))