| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | |
| 3 | export class FlightPositionEntity |
| 4 | @ApiPropertyOptional({ |
| 5 | description: 'FlightAware flight ID for this position', |
| 6 | }) |
| 7 | fa_flight_id?: string |
| 8 | |
| 9 | @ApiProperty({ |
| 10 | description: 'Aircraft altitude in hundreds of feet', |
| 11 | example: 350, |
| 12 | }) |
| 13 | altitude: number; |
| 14 | |
| 15 | @ApiProperty({ |
| 16 | description: 'Altitude change indicator', |
| 17 | enum: ['C', |
| 18 | example: 'C', |
| 19 | }) |
| 20 | altitude_change: string; |
| 21 | |
| 22 | @ApiProperty({ |
| 23 | description: 'Groundspeed in knots', |
| 24 | example: 450, |
| 25 | }) |
| 26 | groundspeed: number; |
| 27 | |
| 28 | @ApiPropertyOptional({ |
| 29 | description: 'Aircraft heading in degrees (0-360)', |
| 30 | example: 270, |
| 31 | minimum: 0, |
| 32 | maximum: 360, |
| 33 | }) |
| 34 | heading?: number |
| 35 | |
| 36 | @ApiProperty({ |
| 37 | description: 'Latitude position', |
| 38 | example: 40.7128, |
| 39 | }) |
| 40 | latitude: number; |
| 41 | |
| 42 | @ApiProperty({ |
| 43 | description: 'Longitude position', |
| 44 | example: -74.0060, |
| 45 | }) |
| 46 | longitude: number; |
| 47 | |
| 48 | @ApiProperty({ |
| 49 | description: 'Time that position was received', |
| 50 | example: '2024-03-20T14:30:00Z', |
| 51 | }) |
| 52 | timestamp: string; |
| 53 | |
| 54 | @ApiPropertyOptional({ |
| 55 | description: 'Update type: P=projected, O=oceanic, Z=radar, A=ADS-B, M=multilateration, D=datalink, X=surface and near surface, S=space-based, V=virtual event', |
| 56 | enum: ['P', |
| 57 | }) |
| 58 | update_type?: string |
| 59 | } |
| 60 | |
| 61 | export class FlightTrackResponseEntity |
| 62 | @ApiPropertyOptional({ |
| 63 | description: 'Distance flown in miles as of the latest position point', |
| 64 | example: 2450, |
| 65 | }) |
| 66 | actual_distance?: number |
| 67 | |
| 68 | @ApiProperty({ |
| 69 | description: 'Array of flight positions', |
| 70 | type: [FlightPositionEntity], |
| 71 | }) |
| 72 | positions: FlightPositionEntity |
| 73 | } |
| 74 | |