GET /getflight
Name | Description | Avaialble Values |
---|---|---|
flightid | The id of the flight | e.g. 1 (int) |
Example
{
'flightid': 1
}
Returns a flight object
Example
{
"status": "success",
"data": {
"flightid": 1,
"planename": "Boeing 747",
"departdate": "2020-01-01",
"departtime": 500,
"arrivedate": "2020-01-01",
"arrivetime": 1400,
"sourceid": "YYZ",
"destinationid": "YYC"
}
}
GET /calculateairtime
Name | Description | Avaialble Values |
---|---|---|
flightids | The ids of the flights | e.g. [1, 2] (array of ints) |
Example
http://jeremymark.ca:3001/calculateairtime?flightids=[560,704]
Example
{
"status": "success",
"data": 900
}
GET /generateoptions
Parameters
Name | Description | Available Values |
---|---|---|
Source | The city where the flight is from | YYZ, YYC, YYV, YBC |
Destination | The city where the flight is to | YYZ, YYC, YYV, YBC |
Number of Stops | The number of stops the total trip has | 0, 1, 2 |
Departure Date | The date of the flight | month/days/yyyy (e.g. 12/25/2020 = december 25, 2020) |
Return Date | The date of the return flight | month/days/yyyy (e.g. 12/25/2020 = december 25, 2020) OR "null", (null would imply the flight is one-way) |
Example
{
"source": "YYZ",
"destination": "YYC",
"numberofstops": 0,
"departuredate": "12-25-2020",
"returndate": "null"
}
{
"departureflights": [
// A -> B
{
"order": 1,
"source": "Toronto",
"destination": "Calgary",
"flights": [
{
"flightid": 1234,
"planename": "Boeing 737",
"departuredate": "12/25/2020",
"departuretime": "1200",
"arrivaldate": "12/25/2020",
"arrivaltime": "1400",
"totaltime": "2h"
},
{
"flightid": 1234,
"planename": "Boeing 737",
"departuredate": "12/25/2020",
"departuretime": "1300",
"arrivaldate": "12/25/2020",
"arrivaltime": "1500",
"totaltime": "2h"
},
]
},
// B -> C
{
"order": 2,
"source": "Calgary",
"destination": "Vancouver",
"flights": [
// ...
]
}
],
"returnflights": "null"
}
GET /generatereceipt
Parameters
Name | Description | Available Values |
---|---|---|
departureflightids | flight ids of departure flight path, order matters | "[1234, 5678, 91011]" |
returnflightids | flight ids of return flight path, order matters | "[121314, 151617, 181920]" |
name | passenger name | "John Doe" |
passenger email | "jeremy.tubongbanua@gmail.com" |
Example
{
"departureflightids": "[1234, 5678, 91011]",
"returnflightids": "null",
"name": "John Doe",
"email": "jremy.@gmail.com"
}
Example
{
"name": "John Doe",
"email": "jremy.@gmail.com",
"departureflights": {
"flights": [
{
"order": 1,
"flightid": 1234,
"planename": "Boeing 737",
"departuredate": "12/25/2020",
"departuretime": "1200",
"arrivaldate": "12/25/2020",
"arrivaltime": "1400",
"totaltime": "1h 43m"
},
{
"order": 2,
"flightid": 5678,
"planename": "Boeing 737",
"departuredate": "12/25/2020",
"departuretime": "1200",
"arrivaldate": "12/25/2020",
"arrivaltime": "1400",
"totaltime": "1h 43m"
},
{
"order": 3,
"flightid": 91011,
"planename": "Boeing 737",
"departuredate": "12/25/2020",
"departuretime": "1200",
"arrivaldate": "12/25/2020",
"arrivaltime": "1400",
"totaltime": "2h"
}
]
"totaltime": "5h 19m"
},
}
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list