| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | |
| 3 | import { FlightBookingEntity } |
| 4 | |
| 5 | export class FlightAwareDataEntity |
| 6 | @ApiProperty() |
| 7 | id: string; |
| 8 | |
| 9 | @ApiProperty({ description |
| 10 | ident: string; |
| 11 | |
| 12 | @ApiPropertyOptional() |
| 13 | identIcao?: string |
| 14 | |
| 15 | @ApiPropertyOptional() |
| 16 | identIata?: string |
| 17 | |
| 18 | @ApiPropertyOptional() |
| 19 | actualRunwayOff?: string |
| 20 | |
| 21 | @ApiPropertyOptional() |
| 22 | actualRunwayOn?: string |
| 23 | |
| 24 | @ApiPropertyOptional() |
| 25 | operator?: string |
| 26 | |
| 27 | @ApiPropertyOptional() |
| 28 | operatorIcao?: string |
| 29 | |
| 30 | @ApiPropertyOptional() |
| 31 | operatorIata?: string |
| 32 | |
| 33 | @ApiPropertyOptional() |
| 34 | flightNumber?: string |
| 35 | |
| 36 | @ApiPropertyOptional() |
| 37 | registration?: string |
| 38 | |
| 39 | @ApiPropertyOptional() |
| 40 | atcIdent?: string |
| 41 | |
| 42 | @ApiPropertyOptional() |
| 43 | inboundFaFlightId?: string |
| 44 | |
| 45 | @ApiPropertyOptional({ type |
| 46 | codesharesIata?: string |
| 47 | |
| 48 | @ApiPropertyOptional({ type |
| 49 | codesharesIcao?: string |
| 50 | |
| 51 | @ApiPropertyOptional({ |
| 52 | description: 'Departure delay in seconds (negative = early)', |
| 53 | }) |
| 54 | departureDelay?: number |
| 55 | |
| 56 | @ApiPropertyOptional({ |
| 57 | description: 'Arrival delay in seconds (negative = early)', |
| 58 | }) |
| 59 | arrivalDelay?: number |
| 60 | |
| 61 | @ApiPropertyOptional({ description |
| 62 | filedEte?: number |
| 63 | |
| 64 | @ApiPropertyOptional({ description |
| 65 | progressPercent?: number |
| 66 | |
| 67 | @ApiProperty({ description |
| 68 | status: string; |
| 69 | |
| 70 | @ApiPropertyOptional() |
| 71 | aircraftType?: string |
| 72 | |
| 73 | @ApiPropertyOptional({ |
| 74 | description: 'Planned flight distance in statute miles', |
| 75 | }) |
| 76 | routeDistance?: number |
| 77 | |
| 78 | @ApiPropertyOptional({ description |
| 79 | filedAirspeed?: number |
| 80 | |
| 81 | @ApiPropertyOptional({ description |
| 82 | filedAltitude?: number |
| 83 | |
| 84 | @ApiPropertyOptional() |
| 85 | route?: string |
| 86 | |
| 87 | @ApiPropertyOptional() |
| 88 | baggageClaim?: string |
| 89 | |
| 90 | @ApiPropertyOptional({ description |
| 91 | seatsCabinBusiness?: number |
| 92 | |
| 93 | @ApiPropertyOptional({ description |
| 94 | seatsCabinCoach?: number |
| 95 | |
| 96 | @ApiPropertyOptional({ description |
| 97 | seatsCabinFirst?: number |
| 98 | |
| 99 | @ApiPropertyOptional() |
| 100 | gateOrigin?: string |
| 101 | |
| 102 | @ApiPropertyOptional() |
| 103 | gateDestination?: string |
| 104 | |
| 105 | @ApiPropertyOptional() |
| 106 | terminalOrigin?: string |
| 107 | |
| 108 | @ApiPropertyOptional() |
| 109 | terminalDestination?: string |
| 110 | |
| 111 | @ApiPropertyOptional() |
| 112 | scheduledOut?: Date |
| 113 | |
| 114 | @ApiPropertyOptional() |
| 115 | estimatedOut?: Date |
| 116 | |
| 117 | @ApiPropertyOptional() |
| 118 | actualOut?: Date |
| 119 | |
| 120 | @ApiPropertyOptional() |
| 121 | scheduledOff?: Date |
| 122 | |
| 123 | @ApiPropertyOptional() |
| 124 | estimatedOff?: Date |
| 125 | |
| 126 | @ApiPropertyOptional() |
| 127 | actualOff?: Date |
| 128 | |
| 129 | @ApiPropertyOptional() |
| 130 | scheduledOn?: Date |
| 131 | |
| 132 | @ApiPropertyOptional() |
| 133 | estimatedOn?: Date |
| 134 | |
| 135 | @ApiPropertyOptional() |
| 136 | actualOn?: Date |
| 137 | |
| 138 | @ApiPropertyOptional() |
| 139 | scheduledIn?: Date |
| 140 | |
| 141 | @ApiPropertyOptional() |
| 142 | estimatedIn?: Date |
| 143 | |
| 144 | @ApiPropertyOptional() |
| 145 | actualIn?: Date |
| 146 | |
| 147 | @ApiProperty({ description |
| 148 | foresightPredictionsAvailable: boolean |
| 149 | |
| 150 | @ApiProperty() |
| 151 | blocked: boolean; |
| 152 | |
| 153 | @ApiProperty() |
| 154 | diverted: boolean; |
| 155 | |
| 156 | @ApiProperty() |
| 157 | cancelled: boolean; |
| 158 | |
| 159 | @ApiProperty() |
| 160 | positionOnly: boolean; |
| 161 | |
| 162 | @ApiPropertyOptional() |
| 163 | originCode?: string |
| 164 | |
| 165 | @ApiPropertyOptional() |
| 166 | originCodeIcao?: string |
| 167 | |
| 168 | @ApiPropertyOptional() |
| 169 | originCodeIata?: string |
| 170 | |
| 171 | @ApiPropertyOptional() |
| 172 | originCodeLid?: string |
| 173 | |
| 174 | @ApiPropertyOptional() |
| 175 | originTimezone?: string |
| 176 | |
| 177 | @ApiPropertyOptional() |
| 178 | originName?: string |
| 179 | |
| 180 | @ApiPropertyOptional() |
| 181 | originCity?: string |
| 182 | |
| 183 | @ApiPropertyOptional() |
| 184 | destinationCode?: string |
| 185 | |
| 186 | @ApiPropertyOptional() |
| 187 | destinationCodeIcao?: string |
| 188 | |
| 189 | @ApiPropertyOptional() |
| 190 | destinationCodeIata?: string |
| 191 | |
| 192 | @ApiPropertyOptional() |
| 193 | destinationCodeLid?: string |
| 194 | |
| 195 | @ApiPropertyOptional() |
| 196 | destinationTimezone?: string |
| 197 | |
| 198 | @ApiPropertyOptional() |
| 199 | destinationName?: string |
| 200 | |
| 201 | @ApiPropertyOptional() |
| 202 | destinationCity?: string |
| 203 | |
| 204 | @ApiProperty() |
| 205 | createdAt: Date |
| 206 | |
| 207 | @ApiProperty() |
| 208 | updatedAt: Date |
| 209 | } |
| 210 | export class AircraftEntity |
| 211 | @ApiPropertyOptional() |
| 212 | modeS: string; |
| 213 | |
| 214 | @ApiPropertyOptional() |
| 215 | registration: string; |
| 216 | |
| 217 | @ApiPropertyOptional() |
| 218 | model: string; |
| 219 | |
| 220 | @ApiPropertyOptional() |
| 221 | image?: string |
| 222 | |
| 223 | @ApiPropertyOptional() |
| 224 | aircraft_id?: string |
| 225 | |
| 226 | @ApiPropertyOptional() |
| 227 | age?: string |
| 228 | |
| 229 | @ApiPropertyOptional() |
| 230 | firstFlightDate?: string |
| 231 | |
| 232 | @ApiPropertyOptional() |
| 233 | deliveryDate?: string |
| 234 | |
| 235 | @ApiPropertyOptional() |
| 236 | isFreighter?: boolean |
| 237 | |
| 238 | @ApiPropertyOptional() |
| 239 | attribution?: string |
| 240 | |
| 241 | @ApiPropertyOptional({ type |
| 242 | payload?: object |
| 243 | } |
| 244 | |
| 245 | class PartialAirlineEntity { |
| 246 | @ApiProperty() |
| 247 | name: string; |
| 248 | |
| 249 | @ApiPropertyOptional() |
| 250 | iata?: string |
| 251 | |
| 252 | @ApiPropertyOptional() |
| 253 | icao?: string |
| 254 | |
| 255 | @ApiPropertyOptional() |
| 256 | image?: string |
| 257 | } |
| 258 | class LocationEntity { |
| 259 | @ApiProperty() |
| 260 | lat: number; |
| 261 | |
| 262 | @ApiProperty() |
| 263 | lon: number; |
| 264 | } |
| 265 | |
| 266 | class RouteAirportEntity { |
| 267 | @ApiProperty() |
| 268 | iata: string; |
| 269 | |
| 270 | @ApiProperty() |
| 271 | icao: string; |
| 272 | |
| 273 | @ApiProperty() |
| 274 | name: string; |
| 275 | |
| 276 | @ApiProperty() |
| 277 | timeZone: string; |
| 278 | |
| 279 | @ApiPropertyOptional() |
| 280 | shortName: string; |
| 281 | |
| 282 | @ApiProperty() |
| 283 | countryCode: string; |
| 284 | |
| 285 | @ApiProperty() |
| 286 | municipalityName: string; |
| 287 | |
| 288 | @ApiProperty() |
| 289 | location: LocationEntity |
| 290 | } |
| 291 | |
| 292 | class TimeEntity { |
| 293 | @ApiProperty() |
| 294 | utc: string; |
| 295 | |
| 296 | @ApiProperty() |
| 297 | local: string; |
| 298 | } |
| 299 | |
| 300 | class RouteInfoEntity { |
| 301 | @ApiProperty() |
| 302 | airport: RouteAirportEntity |
| 303 | |
| 304 | @ApiPropertyOptional() |
| 305 | terminal?: string |
| 306 | |
| 307 | @ApiPropertyOptional() |
| 308 | gate?: string |
| 309 | |
| 310 | @ApiProperty() |
| 311 | scheduledTime?: TimeEntity |
| 312 | |
| 313 | @ApiPropertyOptional() |
| 314 | revisedTime?: TimeEntity |
| 315 | |
| 316 | @ApiPropertyOptional() |
| 317 | predictedTime?: TimeEntity |
| 318 | |
| 319 | @ApiPropertyOptional() |
| 320 | baggageBelt?: string |
| 321 | } |
| 322 | class StringifiedGreatCircleDistanceEntity { |
| 323 | @ApiPropertyOptional() |
| 324 | meter: string; |
| 325 | |
| 326 | @ApiPropertyOptional() |
| 327 | km: string; |
| 328 | |
| 329 | @ApiPropertyOptional() |
| 330 | mile: string; |
| 331 | |
| 332 | @ApiPropertyOptional() |
| 333 | nm: string; |
| 334 | |
| 335 | @ApiPropertyOptional() |
| 336 | feet: string; |
| 337 | } |
| 338 | |
| 339 | export class FlightResponseEntity |
| 340 | @ApiProperty() |
| 341 | id: string; |
| 342 | |
| 343 | @ApiProperty() |
| 344 | flightNo: string; |
| 345 | |
| 346 | @ApiProperty() |
| 347 | callSign: string; |
| 348 | |
| 349 | @ApiPropertyOptional() |
| 350 | aircraft: AircraftEntity |
| 351 | |
| 352 | @ApiProperty() |
| 353 | airline: PartialAirlineEntity |
| 354 | |
| 355 | @ApiProperty() |
| 356 | arrival: RouteInfoEntity |
| 357 | |
| 358 | @ApiProperty() |
| 359 | departure: RouteInfoEntity |
| 360 | |
| 361 | @ApiProperty() |
| 362 | cargo: boolean; |
| 363 | |
| 364 | @ApiProperty() |
| 365 | greatCircleDistance: StringifiedGreatCircleDistanceEntity |
| 366 | |
| 367 | @ApiProperty() |
| 368 | date: Date |
| 369 | |
| 370 | @ApiPropertyOptional() |
| 371 | image?: string |
| 372 | |
| 373 | @ApiPropertyOptional() |
| 374 | flightAwareData?: FlightAwareDataEntity |
| 375 | |
| 376 | @ApiPropertyOptional({ |
| 377 | description: 'Bookings associated with this flight', |
| 378 | type: [FlightBookingEntity], |
| 379 | }) |
| 380 | bookings?: FlightBookingEntity |
| 381 | } |
| 382 | |
| 383 | class FlightSummaryOriginEntity { |
| 384 | @ApiProperty() |
| 385 | code: string; |
| 386 | |
| 387 | @ApiPropertyOptional() |
| 388 | codeIata?: string |
| 389 | |
| 390 | @ApiPropertyOptional() |
| 391 | codeIcao?: string |
| 392 | |
| 393 | @ApiPropertyOptional() |
| 394 | name?: string |
| 395 | |
| 396 | @ApiPropertyOptional() |
| 397 | city?: string |
| 398 | } |
| 399 | |
| 400 | class FlightSummaryDestinationEntity { |
| 401 | @ApiProperty() |
| 402 | code: string; |
| 403 | |
| 404 | @ApiPropertyOptional() |
| 405 | codeIata?: string |
| 406 | |
| 407 | @ApiPropertyOptional() |
| 408 | codeIcao?: string |
| 409 | |
| 410 | @ApiPropertyOptional() |
| 411 | name?: string |
| 412 | |
| 413 | @ApiPropertyOptional() |
| 414 | city?: string |
| 415 | } |
| 416 | |
| 417 | class FlightSummaryAirlineEntity { |
| 418 | @ApiProperty() |
| 419 | name: string; |
| 420 | |
| 421 | @ApiPropertyOptional() |
| 422 | iata?: string |
| 423 | |
| 424 | @ApiPropertyOptional() |
| 425 | icao?: string |
| 426 | |
| 427 | @ApiPropertyOptional() |
| 428 | image?: string |
| 429 | } |
| 430 | |
| 431 | export class FlightCandidateEntity |
| 432 | @ApiProperty({ |
| 433 | description: 'FlightAware flight ID for fetching full details', |
| 434 | }) |
| 435 | faFlightId: string; |
| 436 | |
| 437 | @ApiProperty({ description |
| 438 | ident: string; |
| 439 | |
| 440 | @ApiProperty() |
| 441 | origin: FlightSummaryOriginEntity |
| 442 | |
| 443 | @ApiProperty() |
| 444 | destination: FlightSummaryDestinationEntity |
| 445 | |
| 446 | @ApiPropertyOptional() |
| 447 | scheduledOut?: Date |
| 448 | |
| 449 | @ApiPropertyOptional() |
| 450 | scheduledOff?: Date |
| 451 | |
| 452 | @ApiProperty({ description |
| 453 | status: string; |
| 454 | |
| 455 | @ApiProperty() |
| 456 | airline: FlightSummaryAirlineEntity |
| 457 | } |
| 458 | |
| 459 | export class FlightSearchResponseEntity |
| 460 | @ApiProperty({ |
| 461 | description: 'Array of flight candidates', |
| 462 | type: [FlightCandidateEntity], |
| 463 | }) |
| 464 | flights: FlightCandidateEntity |
| 465 | |
| 466 | @ApiProperty({ description |
| 467 | count: number; |
| 468 | } |