| 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 AircraftRegistrationEntity |
| 211 | @ApiProperty() |
| 212 | id: string; |
| 213 | |
| 214 | @ApiProperty() |
| 215 | reg: string; |
| 216 | |
| 217 | @ApiProperty() |
| 218 | active: boolean; |
| 219 | |
| 220 | @ApiPropertyOptional() |
| 221 | hexIcao?: string |
| 222 | |
| 223 | @ApiPropertyOptional() |
| 224 | airlineName?: string |
| 225 | |
| 226 | @ApiPropertyOptional() |
| 227 | registrationDate?: string |
| 228 | } |
| 229 | |
| 230 | export class AircraftEntity |
| 231 | @ApiPropertyOptional() |
| 232 | modeS: string; |
| 233 | |
| 234 | @ApiPropertyOptional() |
| 235 | registration: string; |
| 236 | |
| 237 | @ApiPropertyOptional() |
| 238 | model: string; |
| 239 | |
| 240 | @ApiPropertyOptional() |
| 241 | image?: string |
| 242 | |
| 243 | @ApiPropertyOptional() |
| 244 | aircraft_id?: string |
| 245 | |
| 246 | @ApiPropertyOptional() |
| 247 | age?: string |
| 248 | |
| 249 | @ApiPropertyOptional() |
| 250 | firstFlightDate?: string |
| 251 | |
| 252 | @ApiPropertyOptional() |
| 253 | deliveryDate?: string |
| 254 | |
| 255 | @ApiPropertyOptional() |
| 256 | isFreighter?: boolean |
| 257 | |
| 258 | @ApiPropertyOptional() |
| 259 | attribution?: string |
| 260 | |
| 261 | @ApiPropertyOptional({ type |
| 262 | payload?: object |
| 263 | |
| 264 | @ApiPropertyOptional({ type |
| 265 | registrations?: AircraftRegistrationEntity |
| 266 | } |
| 267 | |
| 268 | class PartialAirlineEntity { |
| 269 | @ApiProperty() |
| 270 | name: string; |
| 271 | |
| 272 | @ApiPropertyOptional() |
| 273 | iata?: string |
| 274 | |
| 275 | @ApiPropertyOptional() |
| 276 | icao?: string |
| 277 | |
| 278 | @ApiPropertyOptional() |
| 279 | image?: string |
| 280 | } |
| 281 | class LocationEntity { |
| 282 | @ApiProperty() |
| 283 | lat: number; |
| 284 | |
| 285 | @ApiProperty() |
| 286 | lon: number; |
| 287 | } |
| 288 | |
| 289 | class AirportDelayReasonEntity { |
| 290 | @ApiProperty() category |
| 291 | @ApiProperty({ enum |
| 292 | @ApiProperty() delay_secs |
| 293 | @ApiProperty() reason |
| 294 | } |
| 295 | |
| 296 | export class AirportDelaysEntity |
| 297 | @ApiProperty() airport |
| 298 | @ApiProperty() category |
| 299 | @ApiProperty({ enum |
| 300 | @ApiProperty() delay_secs |
| 301 | @ApiProperty({ type |
| 302 | } |
| 303 | |
| 304 | class WeatherForecastWindsEntity { |
| 305 | @ApiProperty() symbol |
| 306 | @ApiProperty() direction |
| 307 | @ApiProperty() speed |
| 308 | @ApiPropertyOptional({ nullable |
| 309 | @ApiPropertyOptional({ nullable |
| 310 | } |
| 311 | |
| 312 | class WeatherForecastWindshearEntity { |
| 313 | @ApiProperty() symbol |
| 314 | @ApiProperty() height |
| 315 | @ApiProperty() direction |
| 316 | @ApiProperty() speed |
| 317 | @ApiPropertyOptional({ nullable |
| 318 | } |
| 319 | |
| 320 | class WeatherForecastVisibilityEntity { |
| 321 | @ApiProperty() symbol |
| 322 | @ApiProperty() visibility |
| 323 | @ApiPropertyOptional({ nullable |
| 324 | } |
| 325 | |
| 326 | class WeatherForecastCloudEntity { |
| 327 | @ApiProperty() symbol |
| 328 | @ApiPropertyOptional({ |
| 329 | enum: ['', 'sky_clear |
| 330 | nullable: true, |
| 331 | }) |
| 332 | coverage?: '' |
| 333 | @ApiPropertyOptional({ nullable |
| 334 | @ApiPropertyOptional({ nullable |
| 335 | } |
| 336 | |
| 337 | class WeatherForecastLineEntity { |
| 338 | @ApiProperty() type |
| 339 | @ApiProperty() start |
| 340 | @ApiPropertyOptional({ nullable |
| 341 | @ApiPropertyOptional({ nullable |
| 342 | @ApiPropertyOptional({ nullable |
| 343 | @ApiPropertyOptional({ nullable |
| 344 | @ApiPropertyOptional({ nullable |
| 345 | @ApiPropertyOptional({ type |
| 346 | @ApiPropertyOptional({ type |
| 347 | @ApiPropertyOptional({ type |
| 348 | @ApiPropertyOptional({ type |
| 349 | } |
| 350 | |
| 351 | class WeatherForecastDecodedEntity { |
| 352 | @ApiProperty() start |
| 353 | @ApiProperty() end |
| 354 | @ApiPropertyOptional({ type |
| 355 | } |
| 356 | |
| 357 | export class AirportWeatherForecastEntity |
| 358 | @ApiProperty() airport_code |
| 359 | @ApiProperty({ type |
| 360 | @ApiProperty() time |
| 361 | @ApiPropertyOptional({ type |
| 362 | } |
| 363 | |
| 364 | class WeatherObservationCloudEntity { |
| 365 | @ApiPropertyOptional({ nullable |
| 366 | @ApiProperty() symbol |
| 367 | @ApiProperty() type |
| 368 | } |
| 369 | |
| 370 | export class AirportWeatherObservationEntity |
| 371 | @ApiProperty() airport_code |
| 372 | @ApiPropertyOptional({ nullable |
| 373 | @ApiPropertyOptional({ type |
| 374 | @ApiPropertyOptional({ nullable |
| 375 | @ApiPropertyOptional({ nullable |
| 376 | @ApiPropertyOptional({ enum |
| 377 | pressure_units?: '' |
| 378 | @ApiProperty() raw_data |
| 379 | @ApiPropertyOptional({ nullable |
| 380 | @ApiPropertyOptional({ nullable |
| 381 | @ApiPropertyOptional({ nullable |
| 382 | @ApiPropertyOptional({ nullable |
| 383 | @ApiProperty() time |
| 384 | @ApiPropertyOptional({ nullable |
| 385 | @ApiPropertyOptional({ enum |
| 386 | visibility_units?: '' |
| 387 | @ApiProperty() wind_direction |
| 388 | @ApiProperty() wind_friendly |
| 389 | @ApiProperty() wind_speed |
| 390 | @ApiProperty() wind_speed_gust |
| 391 | @ApiProperty({ enum |
| 392 | } |
| 393 | |
| 394 | export class AirportConditionsEntity |
| 395 | @ApiPropertyOptional({ type |
| 396 | delays?: AirportDelaysEntity |
| 397 | |
| 398 | @ApiPropertyOptional({ type |
| 399 | forecast?: AirportWeatherForecastEntity |
| 400 | |
| 401 | @ApiPropertyOptional({ type |
| 402 | observation?: AirportWeatherObservationEntity |
| 403 | } |
| 404 | |
| 405 | class RouteAirportEntity { |
| 406 | @ApiProperty() |
| 407 | iata: string; |
| 408 | |
| 409 | @ApiProperty() |
| 410 | icao: string; |
| 411 | |
| 412 | @ApiProperty() |
| 413 | name: string; |
| 414 | |
| 415 | @ApiProperty() |
| 416 | timeZone: string; |
| 417 | |
| 418 | @ApiPropertyOptional() |
| 419 | shortName: string; |
| 420 | |
| 421 | @ApiProperty() |
| 422 | countryCode: string; |
| 423 | |
| 424 | @ApiProperty() |
| 425 | municipalityName: string; |
| 426 | |
| 427 | @ApiProperty() |
| 428 | location: LocationEntity |
| 429 | |
| 430 | @ApiPropertyOptional({ type |
| 431 | conditions?: AirportConditionsEntity |
| 432 | } |
| 433 | |
| 434 | class TimeEntity { |
| 435 | @ApiProperty() |
| 436 | utc: string; |
| 437 | |
| 438 | @ApiProperty() |
| 439 | local: string; |
| 440 | } |
| 441 | |
| 442 | class RouteInfoEntity { |
| 443 | @ApiProperty() |
| 444 | airport: RouteAirportEntity |
| 445 | |
| 446 | @ApiPropertyOptional() |
| 447 | terminal?: string |
| 448 | |
| 449 | @ApiPropertyOptional() |
| 450 | gate?: string |
| 451 | |
| 452 | @ApiProperty() |
| 453 | scheduledTime?: TimeEntity |
| 454 | |
| 455 | @ApiPropertyOptional() |
| 456 | revisedTime?: TimeEntity |
| 457 | |
| 458 | @ApiPropertyOptional() |
| 459 | predictedTime?: TimeEntity |
| 460 | |
| 461 | @ApiPropertyOptional() |
| 462 | baggageBelt?: string |
| 463 | } |
| 464 | class StringifiedGreatCircleDistanceEntity { |
| 465 | @ApiPropertyOptional() |
| 466 | meter: string; |
| 467 | |
| 468 | @ApiPropertyOptional() |
| 469 | km: string; |
| 470 | |
| 471 | @ApiPropertyOptional() |
| 472 | mile: string; |
| 473 | |
| 474 | @ApiPropertyOptional() |
| 475 | nm: string; |
| 476 | |
| 477 | @ApiPropertyOptional() |
| 478 | feet: string; |
| 479 | } |
| 480 | |
| 481 | export class FlightResponseEntity |
| 482 | @ApiProperty() |
| 483 | id: string; |
| 484 | |
| 485 | @ApiProperty() |
| 486 | flightNo: string; |
| 487 | |
| 488 | @ApiProperty() |
| 489 | callSign: string; |
| 490 | |
| 491 | @ApiPropertyOptional() |
| 492 | aircraft: AircraftEntity |
| 493 | |
| 494 | @ApiProperty() |
| 495 | airline: PartialAirlineEntity |
| 496 | |
| 497 | @ApiProperty() |
| 498 | arrival: RouteInfoEntity |
| 499 | |
| 500 | @ApiProperty() |
| 501 | departure: RouteInfoEntity |
| 502 | |
| 503 | @ApiProperty() |
| 504 | cargo: boolean; |
| 505 | |
| 506 | @ApiProperty() |
| 507 | greatCircleDistance: StringifiedGreatCircleDistanceEntity |
| 508 | |
| 509 | @ApiProperty() |
| 510 | date: Date |
| 511 | |
| 512 | @ApiPropertyOptional() |
| 513 | image?: string |
| 514 | |
| 515 | @ApiPropertyOptional() |
| 516 | flightAwareData?: FlightAwareDataEntity |
| 517 | |
| 518 | @ApiPropertyOptional({ |
| 519 | description: 'Bookings associated with this flight', |
| 520 | type: [FlightBookingEntity], |
| 521 | }) |
| 522 | bookings?: FlightBookingEntity |
| 523 | } |
| 524 | |
| 525 | class FlightSummaryOriginEntity { |
| 526 | @ApiProperty() |
| 527 | code: string; |
| 528 | |
| 529 | @ApiPropertyOptional() |
| 530 | codeIata?: string |
| 531 | |
| 532 | @ApiPropertyOptional() |
| 533 | codeIcao?: string |
| 534 | |
| 535 | @ApiPropertyOptional() |
| 536 | name?: string |
| 537 | |
| 538 | @ApiPropertyOptional() |
| 539 | city?: string |
| 540 | } |
| 541 | |
| 542 | class FlightSummaryDestinationEntity { |
| 543 | @ApiProperty() |
| 544 | code: string; |
| 545 | |
| 546 | @ApiPropertyOptional() |
| 547 | codeIata?: string |
| 548 | |
| 549 | @ApiPropertyOptional() |
| 550 | codeIcao?: string |
| 551 | |
| 552 | @ApiPropertyOptional() |
| 553 | name?: string |
| 554 | |
| 555 | @ApiPropertyOptional() |
| 556 | city?: string |
| 557 | } |
| 558 | |
| 559 | class FlightSummaryAirlineEntity { |
| 560 | @ApiProperty() |
| 561 | name: string; |
| 562 | |
| 563 | @ApiPropertyOptional() |
| 564 | iata?: string |
| 565 | |
| 566 | @ApiPropertyOptional() |
| 567 | icao?: string |
| 568 | |
| 569 | @ApiPropertyOptional() |
| 570 | image?: string |
| 571 | } |
| 572 | |
| 573 | export class FlightCandidateEntity |
| 574 | @ApiProperty({ |
| 575 | description: 'FlightAware flight ID for fetching full details', |
| 576 | }) |
| 577 | faFlightId: string; |
| 578 | |
| 579 | @ApiProperty({ description |
| 580 | ident: string; |
| 581 | |
| 582 | @ApiProperty() |
| 583 | origin: FlightSummaryOriginEntity |
| 584 | |
| 585 | @ApiProperty() |
| 586 | destination: FlightSummaryDestinationEntity |
| 587 | |
| 588 | @ApiPropertyOptional() |
| 589 | scheduledOut?: Date |
| 590 | |
| 591 | @ApiPropertyOptional() |
| 592 | scheduledOff?: Date |
| 593 | |
| 594 | @ApiProperty({ description |
| 595 | status: string; |
| 596 | |
| 597 | @ApiProperty() |
| 598 | airline: FlightSummaryAirlineEntity |
| 599 | } |
| 600 | |
| 601 | export class FlightSearchResponseEntity |
| 602 | @ApiProperty({ |
| 603 | description: 'Array of flight candidates', |
| 604 | type: [FlightCandidateEntity], |
| 605 | }) |
| 606 | flights: FlightCandidateEntity |
| 607 | |
| 608 | @ApiProperty({ description |
| 609 | count: number; |
| 610 | } |