{"$id": "https://hst.tzzr.eu/schemas/ppt.1.0.json", "type": "object", "title": "HST Passport", "$schema": "https://json-schema.org/draft/2020-12/schema", "required": ["L1_document", "L2_holder", "L3_mrz", "L8_status", "L9_metadata"], "properties": {"L3_mrz": {"type": "object", "required": ["format", "line1", "line2"], "properties": {"line1": {"type": "string", "pattern": "^[A-Z0-9<]{44}$", "description": "Primera línea MRZ (tipo + país + nombre)"}, "line2": {"type": "string", "pattern": "^[A-Z0-9<]{44}$", "description": "Segunda línea MRZ (número + datos + checks)"}, "format": {"type": "string", "const": "TD3"}, "parsed": {"type": "object", "properties": {"sex": {"enum": ["M", "F", "<"], "type": "string"}, "name": {"type": "string", "description": "SURNAME<<GIVEN<NAMES"}, "expiry_date": {"type": "string", "pattern": "^[0-9]{6}$", "description": "YYMMDD"}, "nationality": {"type": "string", "pattern": "^[A-Z]{3}$"}, "date_of_birth": {"type": "string", "pattern": "^[0-9]{6}$", "description": "YYMMDD"}, "document_type": {"type": "string", "pattern": "^P[A-Z<]?$", "description": "P< = Passport"}, "issuing_state": {"type": "string", "pattern": "^[A-Z]{3}$"}, "check_digit_dob": {"type": "string", "pattern": "^[0-9]$"}, "check_digit_doc": {"type": "string", "pattern": "^[0-9]$"}, "check_digit_exp": {"type": "string", "pattern": "^[0-9]$"}, "document_number": {"type": "string", "maxLength": 9}, "personal_number": {"type": "string", "maxLength": 14}, "check_digit_personal": {"type": "string", "pattern": "^[0-9<]$"}, "check_digit_composite": {"type": "string", "pattern": "^[0-9]$"}}}, "present": {"type": "boolean", "const": true}, "checksums_valid": {"type": "boolean"}, "checksum_details": {"type": "object", "properties": {"composite": {"type": "boolean"}, "expiry_date": {"type": "boolean"}, "date_of_birth": {"type": "boolean"}, "document_number": {"type": "boolean"}, "personal_number": {"type": "boolean"}}}}, "description": "Machine Readable Zone (TD3: 2 líneas × 44 caracteres)"}, "L4_chip": {"type": "object", "properties": {"sod": {"type": "object", "properties": {"present": {"type": "boolean"}, "hash_algorithm": {"enum": ["SHA-1", "SHA-256", "SHA-384", "SHA-512"], "type": "string"}, "signature_algorithm": {"enum": ["RSA", "RSA-PSS", "ECDSA"], "type": "string"}}, "description": "Document Security Object"}, "present": {"type": "boolean"}, "technology": {"enum": ["ISO_14443_A", "ISO_14443_B"], "type": "string", "description": "Tecnología RFID (13.56 MHz)"}, "data_groups": {"type": "object", "properties": {"DG1": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "MRZ data"}}}, "DG2": {"type": "object", "properties": {"format": {"enum": ["JPEG", "JPEG2000"], "type": "string"}, "present": {"type": "boolean"}, "description": {"type": "string", "const": "Facial image"}}}, "DG3": {"type": "object", "properties": {"fingers": {"type": "array", "items": {"type": "string"}}, "present": {"type": "boolean"}, "description": {"type": "string", "const": "Fingerprints (EAC protected)"}}}, "DG4": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Iris (EAC protected)"}}}, "DG5": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Displayed portrait"}}}, "DG7": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Signature image"}}}, "DG11": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Additional personal details"}}}, "DG12": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Additional document details"}}}, "DG13": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Optional details (country-specific)"}}}, "DG14": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Chip Authentication public key"}}}, "DG15": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Active Authentication public key"}}}, "DG16": {"type": "object", "properties": {"present": {"type": "boolean"}, "description": {"type": "string", "const": "Persons to notify"}}}}, "description": "Data Groups presentes en el chip"}, "read_result": {"type": "object", "properties": {"success": {"type": "boolean"}, "bac_used": {"type": "boolean"}, "chip_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "NOT_SUPPORTED"], "type": "string"}, "pace_used": {"type": "boolean"}, "active_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "NOT_SUPPORTED"], "type": "string"}, "passive_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "UNKNOWN_ISSUER"], "type": "string"}, "terminal_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "NOT_SUPPORTED"], "type": "string"}}}, "protocols_supported": {"type": "array", "items": {"enum": ["BAC", "PACE", "PA", "AA", "CA", "TA"], "type": "string"}, "description": "Protocolos de seguridad soportados"}}, "description": "Chip electrónico ePassport (ICAO Doc 9303 Part 9)"}, "L5_visas": {"type": "array", "items": {"type": "object", "required": ["country", "visa_type", "issue_date", "expiry_date", "entries"], "properties": {"mrz": {"type": "object", "properties": {"line1": {"type": "string"}, "line2": {"type": "string"}, "format": {"enum": ["MRV-A", "MRV-B"], "type": "string"}}, "description": "MRZ del visado (MRV-A o MRV-B)"}, "status": {"enum": ["VALID", "EXPIRED", "USED", "CANCELLED"], "type": "string", "description": "Estado del visado"}, "country": {"type": "string", "pattern": "^[A-Z]{3}$", "description": "País que emite el visado"}, "entries": {"enum": ["SINGLE", "DOUBLE", "MULTIPLE"], "type": "string", "description": "Número de entradas permitidas"}, "visa_id": {"type": "string", "format": "uuid"}, "visa_type": {"type": "string", "description": "Tipo de visado (turista, trabajo, estudiante, etc.)"}, "issue_date": {"type": "string", "format": "date"}, "valid_from": {"type": "string", "format": "date"}, "expiry_date": {"type": "string", "format": "date"}, "issue_place": {"type": "string"}, "page_number": {"type": "integer", "description": "Página del pasaporte donde está el visado"}, "visa_number": {"type": "string"}, "duration_days": {"type": "integer", "description": "Duración máxima de estancia por entrada"}, "visa_category": {"type": "string", "description": "Categoría específica del país (B1/B2, Schengen C, etc.)"}, "issuing_authority": {"type": "string"}}}, "description": "Visados contenidos en el pasaporte"}, "L2_holder": {"type": "object", "required": ["holder_ref", "primary_identifier", "date_of_birth", "sex", "nationality"], "properties": {"sex": {"enum": ["M", "F", "X", "<"], "type": "string", "description": "Sexo: M=Male, F=Female, X=Unspecified"}, "photo": {"type": "object", "properties": {"format": {"enum": ["JPEG", "JPEG2000"], "type": "string"}, "source": {"enum": ["SCAN", "CHIP_DG2", "CHIP_DG5"], "type": "string"}, "present": {"type": "boolean"}}}, "signature": {"type": "object", "properties": {"present": {"type": "boolean"}}}, "holder_ref": {"type": "string", "pattern": "^ppl:[a-f0-9-]{36}$", "description": "Referencia a la entidad persona (ppl:uuid)"}, "nationality": {"type": "string", "pattern": "^[A-Z]{3}$", "description": "Nacionalidad (puede diferir del país emisor)"}, "date_of_birth": {"type": "string", "format": "date"}, "full_name_viz": {"type": "string", "description": "Nombre completo como aparece impreso (VIZ)"}, "place_of_birth": {"type": "string"}, "full_name_local": {"type": "string", "description": "Nombre en escritura local si aplica"}, "personal_number": {"type": "string", "description": "Número personal/nacional (campo opcional MRZ)"}, "primary_identifier": {"type": "string", "description": "Apellido(s) según MRZ"}, "secondary_identifier": {"type": "string", "description": "Nombre(s) según MRZ"}}, "description": "Datos del titular TAL COMO FIGURAN en el pasaporte"}, "L6_stamps": {"type": "array", "items": {"type": "object", "required": ["country", "type", "date"], "properties": {"date": {"type": "string", "format": "date"}, "type": {"enum": ["ENTRY", "EXIT", "TRANSIT"], "type": "string", "description": "Tipo de sello"}, "notes": {"type": "string"}, "country": {"type": "string", "pattern": "^[A-Z]{3}$"}, "stamp_id": {"type": "string", "format": "uuid"}, "page_number": {"type": "integer"}, "port_of_entry": {"type": "string", "description": "Puerto, aeropuerto o frontera"}, "transport_mode": {"enum": ["AIR", "SEA", "LAND", "RAIL"], "type": "string", "description": "Modo de transporte"}}}, "description": "Sellos de entrada y salida"}, "L8_status": {"type": "object", "required": ["status"], "properties": {"alerts": {"type": "array", "items": {"type": "object", "properties": {"type": {"enum": ["INTERPOL", "SLTD", "NATIONAL", "IMMIGRATION"], "type": "string"}, "reason": {"type": "string"}, "database": {"type": "string"}, "alert_date": {"type": "string", "format": "date"}}}}, "status": {"enum": ["VALID", "EXPIRED", "REVOKED", "LOST", "STOLEN", "DESTROYED", "FULL", "RENEWED", "SUSPENDED"], "type": "string", "description": "Estado actual del pasaporte"}, "renewal": {"type": "object", "properties": {"next_passport": {"type": "string", "description": "ref:ppt:uuid del pasaporte renovado"}, "previous_passport": {"type": "string", "description": "ref:ppt:uuid del pasaporte anterior"}}}, "validity": {"type": "object", "properties": {"is_valid": {"type": "boolean"}, "expired_days_ago": {"type": "integer"}, "days_until_expiry": {"type": "integer"}, "six_month_rule_ok": {"type": "boolean", "description": "¿Tiene >6 meses validez? (requisito común)"}}}, "status_date": {"type": "string", "format": "date-time"}, "pages_status": {"type": "object", "properties": {"is_full": {"type": "boolean"}, "total_pages": {"type": "integer"}, "visa_pages_available": {"type": "integer"}}}, "status_reason": {"type": "string"}}, "description": "Estado y ciclo de vida del pasaporte"}, "L1_document": {"type": "object", "required": ["document_id", "issuing_country", "passport_type", "document_number", "issue_date", "expiry_date"], "properties": {"pages": {"enum": [32, 48], "type": "integer", "description": "Número de páginas del pasaporte"}, "format": {"type": "string", "const": "TD3", "description": "Todos los pasaportes son TD3"}, "issue_date": {"type": "string", "format": "date"}, "document_id": {"type": "string", "format": "uuid", "description": "Identificador único HST del pasaporte"}, "expiry_date": {"type": "string", "format": "date"}, "issue_place": {"type": "string"}, "is_biometric": {"type": "boolean", "description": "Indica si es ePassport (chip presente)"}, "passport_type": {"enum": ["P", "PO", "PD", "PS", "PE"], "type": "string", "description": "P=Standard, PO=Ordinary, PD=Diplomatic, PS=Service/Official, PE=Emergency"}, "document_number": {"type": "string", "maxLength": 9, "description": "Número del pasaporte (máx 9 caracteres según ICAO)"}, "issuing_country": {"type": "string", "pattern": "^[A-Z]{3}$", "description": "País emisor (ISO 3166-1 alpha-3)"}, "issuing_authority": {"type": "string", "description": "Autoridad emisora"}}, "description": "Información del documento físico"}, "L7_security": {"type": "object", "properties": {"hologram": {"type": "boolean"}, "watermark": {"type": "boolean"}, "uv_features": {"type": "boolean"}, "microprinting": {"type": "boolean"}, "rfid_shielding": {"type": "boolean", "description": "Blindaje metálico en cubierta (USA, etc.)"}, "laser_engraving": {"type": "boolean"}, "intaglio_printing": {"type": "boolean"}, "laser_perforation": {"type": "boolean"}, "polycarbonate_data_page": {"type": "boolean"}, "optically_variable_device": {"type": "boolean"}}, "description": "Características de seguridad física"}, "L9_metadata": {"type": "object", "required": ["schema_version", "created_at"], "properties": {"created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "captured_at": {"type": "string", "format": "date-time"}, "verification": {"type": "object", "properties": {"verified": {"type": "boolean"}, "verified_at": {"type": "string", "format": "date-time"}, "verified_by": {"type": "string"}, "verification_method": {"enum": ["VISUAL", "MRZ_ONLY", "CHIP_BAC", "CHIP_PACE", "CHIP_FULL_PA", "CHIP_FULL_EAC"], "type": "string"}}}, "source_system": {"type": "string"}, "capture_method": {"enum": ["MANUAL", "OCR_SCAN", "NFC_READ", "API_IMPORT"], "type": "string"}, "schema_version": {"type": "string", "const": "ppt.1.0"}}, "description": "Metadatos del registro"}}}