RahalCorporate
TravelersReference

Field Definitions

Complete field reference for travelers, passports, and documents

Field Definitions

Complete reference for all fields in the traveler management system.

Traveler Fields

Core Fields

FieldTypeRequiredDescription
idstringAutoUnique identifier (CUID)
userIdstringYesReference to owning user
titleenumYesSalutation (mr, mrs, ms, miss, mstr)
firstNamestringYesFirst/given name
lastNamestringYesLast/family name
emailAddressstringNoEmail address
phonePrefixstringYesPhone country code
phoneNumberstringYesPhone number without country code
birthDatedateYesDate of birth
createdAtdatetimeAutoRecord creation timestamp
updatedAtdatetimeAutoLast update timestamp
deletedAtdatetimeAutoSoft delete timestamp (null if active)

Travelers, passports, and documents use soft delete. When deleted, the deletedAt field is set rather than removing the record. This preserves historical data for audit trails and booking history.

Calculated Fields

FieldTypeDescription
agenumberCurrent age in years (calculated from birthDate)
travelerTypeenumADT/CHD/INF (calculated from age)
phonestringCombined phone prefix and number

Relationships

FieldTypeDescription
userobjectLinked user details
passportsarrayAssociated passports
_count.documentsnumberDocument count

Passport Fields

Core Fields

FieldTypeRequiredDescription
idstringAutoUnique identifier (CUID)
travelerIdstringYesReference to traveler
passportNumberstringYesOfficial passport number
nationalitystringYesISO 3166-1 alpha-2 country code
issuingCountrystringYesISO 3166-1 alpha-2 country code
issuingDatedateYesDate passport was issued
expiryDatedateYesDate passport expires
isPrimarybooleanNoWhether this is the primary passport
createdAtdatetimeAutoRecord creation timestamp
updatedAtdatetimeAutoLast update timestamp
deletedAtdatetimeAutoSoft delete timestamp

Calculated Fields

FieldTypeDescription
expiresInDaysnumberDays until expiry (negative if expired)

Constraints

ConstraintDescription
Unique nationalityOne passport per nationality per traveler
Primary uniquenessOnly one primary passport per traveler
Date orderingexpiryDate must be after issuingDate

Document Fields

Core Fields

FieldTypeRequiredDescription
idstringAutoUnique identifier (CUID)
travelerIdstringYesReference to traveler
documentCategoryenumYesPASSPORT, VISA, RESIDENCY, OTHER
relatedEntityIdstringNoID of linked entity (e.g., passport)
relatedEntityTypestringNoType of linked entity
labelstringNoCustom label (max 200 chars)
storageKeystringAutoS3 storage key
fileNamestringAutoOriginal filename
mimeTypestringAutoFile MIME type
uploadedAtdatetimeAutoUpload timestamp
deletedAtdatetimeAutoSoft delete timestamp

Calculated Fields

FieldTypeDescription
downloadUrlstringTemporary signed URL for download

Enum Values

TravelerTitle

ValueDisplayUsage
mrMr.Adult male
mrsMrs.Married adult female
msMs.Adult female (neutral)
missMissUnmarried female or girl
mstrMasterMale child

TravelerType (Calculated)

ValueDisplayAge Range
ADTAdult12+ years
CHDChild2-11 years
INFInfantUnder 2 years

DocumentCategory

ValueDisplayUsage
PASSPORTPassportPassport scans
VISAVisaVisa documents
RESIDENCYResidencyResidence permits
OTHEROtherMiscellaneous

Country Codes

Nationality and issuing country use ISO 3166-1 alpha-2 codes:

CodeCountry
IQIraq
USUnited States
GBUnited Kingdom
DEGermany
JOJordan
AEUnited Arab Emirates
...(All ISO 3166-1 alpha-2 codes)

File Types

Supported MIME Types

ExtensionMIME Type
.pdfapplication/pdf
.jpg, .jpegimage/jpeg
.pngimage/png

Size Limits

LimitValue
Maximum file size10 MB
Maximum files per upload10

Validation Rules

Name Fields

RuleConstraint
Minimum length1 character
Maximum length255 characters
CharactersLetters, spaces, hyphens, apostrophes

Passport Number

RuleConstraint
Minimum length6 characters
Maximum length20 characters
CharactersAlphanumeric

Phone Number

RuleConstraint
FormatCountry code + number
ValidationE.164 format

Email

RuleConstraint
FormatValid email address
RequiredNo

Dates

FieldConstraint
birthDateMust be in the past
issuingDateMust be before expiryDate
expiryDateMust be after issuingDate

On this page