| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | |
| 3 | class MostFlownAircraftEntity { |
| 4 | @ApiProperty() |
| 5 | aircraftName: string; |
| 6 | |
| 7 | @ApiProperty() |
| 8 | flightCount: number; |
| 9 | } |
| 10 | |
| 11 | class PassportEntity { |
| 12 | @ApiProperty({ description |
| 13 | totalFlights: number; |
| 14 | |
| 15 | @ApiProperty({ description |
| 16 | totalDistanceKm: number; |
| 17 | |
| 18 | @ApiProperty({ description |
| 19 | totalDurationMinutes: number; |
| 20 | |
| 21 | @ApiProperty({ description |
| 22 | totalAirports: number; |
| 23 | |
| 24 | @ApiProperty({ description |
| 25 | totalAirlines: number; |
| 26 | } |
| 27 | |
| 28 | class FlightSummaryAirlineEntity { |
| 29 | @ApiProperty() |
| 30 | name: string; |
| 31 | |
| 32 | @ApiPropertyOptional() |
| 33 | iata?: string |
| 34 | |
| 35 | @ApiPropertyOptional() |
| 36 | icao?: string |
| 37 | |
| 38 | @ApiPropertyOptional() |
| 39 | image?: string |
| 40 | } |
| 41 | |
| 42 | export class FlightSummaryEntity |
| 43 | @ApiProperty() |
| 44 | id: string; |
| 45 | |
| 46 | @ApiProperty() |
| 47 | flightNo: string; |
| 48 | |
| 49 | @ApiProperty() |
| 50 | callSign: string; |
| 51 | |
| 52 | @ApiProperty({ type |
| 53 | airline: FlightSummaryAirlineEntity |
| 54 | |
| 55 | @ApiProperty({ description |
| 56 | departureAirportCode: string; |
| 57 | |
| 58 | @ApiProperty({ description |
| 59 | departureAirportName: string; |
| 60 | |
| 61 | @ApiProperty({ description |
| 62 | arrivalAirportCode: string; |
| 63 | |
| 64 | @ApiProperty({ description |
| 65 | arrivalAirportName: string; |
| 66 | |
| 67 | @ApiProperty({ description |
| 68 | date: string; |
| 69 | } |
| 70 | |
| 71 | class FlightDistanceEntity { |
| 72 | @ApiProperty({ type |
| 73 | flight: FlightSummaryEntity |
| 74 | |
| 75 | @ApiProperty({ description |
| 76 | distanceKm: number; |
| 77 | } |
| 78 | |
| 79 | class FlightDurationEntity { |
| 80 | @ApiProperty({ type |
| 81 | flight: FlightSummaryEntity |
| 82 | |
| 83 | @ApiProperty({ description |
| 84 | durationMinutes: number; |
| 85 | } |
| 86 | |
| 87 | class AirlineStatsEntity { |
| 88 | @ApiProperty() |
| 89 | airlineName: string; |
| 90 | |
| 91 | @ApiProperty() |
| 92 | airlineIata: string; |
| 93 | |
| 94 | @ApiPropertyOptional() |
| 95 | airlineIcao?: string |
| 96 | |
| 97 | @ApiPropertyOptional({ description |
| 98 | image?: string |
| 99 | |
| 100 | @ApiProperty() |
| 101 | flightCount: number; |
| 102 | } |
| 103 | |
| 104 | class AirportStatsEntity { |
| 105 | @ApiProperty() |
| 106 | airportCode: string; |
| 107 | |
| 108 | @ApiProperty() |
| 109 | airportName: string; |
| 110 | |
| 111 | @ApiProperty({ description |
| 112 | departureCount: number; |
| 113 | } |
| 114 | |
| 115 | class TopRouteEntity { |
| 116 | @ApiProperty() |
| 117 | origin: string; |
| 118 | |
| 119 | @ApiProperty() |
| 120 | destination: string; |
| 121 | |
| 122 | @ApiProperty() |
| 123 | flightCount: number; |
| 124 | } |
| 125 | |
| 126 | class AircraftWithAge { |
| 127 | @ApiProperty() |
| 128 | aircraftName: string; |
| 129 | |
| 130 | @ApiProperty() |
| 131 | tailNumber: string; |
| 132 | |
| 133 | @ApiPropertyOptional() |
| 134 | age?: number |
| 135 | |
| 136 | @ApiPropertyOptional() |
| 137 | image?: string |
| 138 | } |
| 139 | |
| 140 | class AircraftStatsEntity { |
| 141 | @ApiProperty() |
| 142 | mostFlownAircraftName: string; |
| 143 | |
| 144 | @ApiProperty() |
| 145 | mostFlownAircraftFlightCount: number |
| 146 | |
| 147 | @ApiPropertyOptional() |
| 148 | mostFlownAircraftImage?: string |
| 149 | |
| 150 | @ApiProperty({ type |
| 151 | mostFlownAircraftFlights: FlightSummaryEntity |
| 152 | |
| 153 | @ApiProperty() |
| 154 | mostCommonTailNumber: string; |
| 155 | |
| 156 | @ApiProperty() |
| 157 | mostCommonTailNumberCount: number |
| 158 | |
| 159 | @ApiPropertyOptional() |
| 160 | medianAge?: number |
| 161 | |
| 162 | @ApiPropertyOptional({ type |
| 163 | youngestAircraft?: AircraftWithAge |
| 164 | |
| 165 | @ApiPropertyOptional({ type |
| 166 | oldestAircraft?: AircraftWithAge |
| 167 | } |
| 168 | |
| 169 | export class ProfileStatsResponseEntity |
| 170 | @ApiProperty({ type |
| 171 | mostFlownAircraft: MostFlownAircraftEntity |
| 172 | |
| 173 | @ApiPropertyOptional({ type |
| 174 | aircraftStats?: AircraftStatsEntity |
| 175 | |
| 176 | @ApiProperty({ type |
| 177 | passport: PassportEntity |
| 178 | |
| 179 | @ApiProperty({ type |
| 180 | shortestDistanceFlight: FlightDistanceEntity |
| 181 | |
| 182 | @ApiProperty({ type |
| 183 | longestDistanceFlight: FlightDistanceEntity |
| 184 | |
| 185 | @ApiProperty({ type |
| 186 | shortestDurationFlight: FlightDurationEntity |
| 187 | |
| 188 | @ApiProperty({ type |
| 189 | longestDurationFlight: FlightDurationEntity |
| 190 | |
| 191 | @ApiProperty({ type |
| 192 | airlines: AirlineStatsEntity |
| 193 | |
| 194 | @ApiProperty({ type |
| 195 | airports: AirportStatsEntity |
| 196 | |
| 197 | @ApiProperty({ type |
| 198 | topRoutes: TopRouteEntity |
| 199 | } |
| 200 | |