Skip to content

Instantly share code, notes, and snippets.

@Lucifier129
Last active April 9, 2021 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lucifier129/8886a309280246bf4a71ecef7f5135d1 to your computer and use it in GitHub Desktop.
Save Lucifier129/8886a309280246bf4a71ecef7f5135d1 to your computer and use it in GitHub Desktop.
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