Last active
April 9, 2021 03:32
-
-
Save Lucifier129/8886a309280246bf4a71ecef7f5135d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PassengerEnName = { | |
type: 'PassengerEnName'; | |
firstname: string; | |
middlename?: string; | |
lastname: string; | |
}; | |
type PassengerCnName = { | |
type: 'PassengerCnName'; | |
firstname: string; | |
lastname: string; | |
}; | |
type PassengerName = PassengerEnName | PassengerCnName; | |
type TelephoneContact = { | |
type: 'TelephoneContact'; | |
tel: string; | |
}; | |
type MobilePhoneContact = { | |
type: 'MobilePhoneContact'; | |
mobile: string; | |
}; | |
type PassengerContact = TelephoneContact | MobilePhoneContact; | |
type AdultPassenger = { | |
type: 'AdultPassenger'; | |
id: number; | |
name: PassengerName; | |
age: number; | |
contact: PassengerContact; | |
}; | |
type ChildPassengerFather = { | |
type: 'ChildPassengerFather'; | |
fatherId: number; | |
}; | |
type ChildPassengerMother = { | |
type: 'ChildPassengerMother'; | |
motherId: number; | |
}; | |
type ChildPassengerParents = { | |
type: 'ChildPassengerParents'; | |
fatherId: number; | |
motherId: number; | |
}; | |
type ChildPassengerParent = | |
| ChildPassengerFather | |
| ChildPassengerMother | |
| ChildPassengerParents; | |
type ChildPassenger = { | |
type: 'ChildPassenger'; | |
id: number; | |
name: PassengerName; | |
age: number; | |
parent: ChildPassengerParent; | |
}; | |
type Passenger = AdultPassenger | ChildPassenger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment