introduce the database and controller connections for all inbounds
This commit is contained in:
44
src/inbound/dto/aircraft.dto.ts
Normal file
44
src/inbound/dto/aircraft.dto.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { IsNotEmpty, Length, IsInt, Min, Max } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class AircraftDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The ICAO code of the aircraft',
|
||||
example: 'A359',
|
||||
})
|
||||
type: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The Wake Turbulence Category (possible: L, M, H, S)',
|
||||
example: 'M',
|
||||
})
|
||||
@Length(1)
|
||||
wtc: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The Wake Turbulence Category (possible: A, B, C, D, E, F)',
|
||||
example: 'C',
|
||||
})
|
||||
@Length(1)
|
||||
wakeRecat: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The number of engines',
|
||||
example: 2,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
engineCount: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The engine type (possible: ELECTRIC, TURBOPROP, JET)',
|
||||
example: 'JET',
|
||||
})
|
||||
engineType: string;
|
||||
}
|
||||
32
src/inbound/dto/controllerinput.dto.ts
Normal file
32
src/inbound/dto/controllerinput.dto.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { IsNotEmpty, IsOptional, IsDateString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { WaypointDto } from '../../generic/dto/waypoint.dto';
|
||||
|
||||
export class ControllerInputDto {
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: 'The timestamp of the last report',
|
||||
})
|
||||
@IsDateString()
|
||||
reportedTime: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The remaining route of the inbound',
|
||||
})
|
||||
remainingRoute: WaypointDto[];
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: 'The requested runway by the pilot',
|
||||
example: '25L',
|
||||
})
|
||||
requestedRunway: string;
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: 'The planned stand after landing',
|
||||
example: 'A05',
|
||||
})
|
||||
plannedStand: string;
|
||||
}
|
||||
49
src/inbound/dto/flightstate.dto.ts
Normal file
49
src/inbound/dto/flightstate.dto.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { IsNotEmpty, IsInt, Min, Max } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { CoordinateDto } from '../../generic/dto/coordinate.dto';
|
||||
|
||||
export class FlightStateDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The current position',
|
||||
})
|
||||
position: CoordinateDto;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The reported ground speed',
|
||||
example: 400,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(700)
|
||||
groundSpeed: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The reported ground track',
|
||||
example: 400,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(360)
|
||||
groundTrack: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The reported altitude',
|
||||
example: 30000,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(60000)
|
||||
altitude: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The reported vertical speed',
|
||||
example: 400,
|
||||
})
|
||||
@IsInt()
|
||||
verticalSpeed: number;
|
||||
}
|
||||
56
src/inbound/dto/inbound.dto.ts
Normal file
56
src/inbound/dto/inbound.dto.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { IsNotEmpty, IsOptional, Length } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { AircraftDto } from './aircraft.dto';
|
||||
import { ControllerInputDto } from './controllerinput.dto';
|
||||
import { FlightStateDto } from './flightstate.dto';
|
||||
import { PlanningDto } from './planning.dto';
|
||||
|
||||
export class InboundDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The used callsign',
|
||||
example: 'DLH3PM',
|
||||
})
|
||||
callsign: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The filed destination',
|
||||
example: 'EDDB',
|
||||
})
|
||||
@Length(4)
|
||||
destination: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description:
|
||||
'The reported controller level (possible: UNK, DEL, GRD, TWR, APP, DEP, CTR)',
|
||||
example: 'EDDB',
|
||||
})
|
||||
@Length(3)
|
||||
reporter: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The used aircraft',
|
||||
})
|
||||
aircraft: AircraftDto;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The current flight state',
|
||||
})
|
||||
flightState: FlightStateDto;
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: 'The data given by the controller',
|
||||
})
|
||||
controllerData: ControllerInputDto;
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: 'The planned arrival',
|
||||
})
|
||||
plan: PlanningDto;
|
||||
}
|
||||
31
src/inbound/dto/planning.dto.ts
Normal file
31
src/inbound/dto/planning.dto.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { PredictedWaypointDto } from './predictedwaypoint.dto';
|
||||
|
||||
export class PlanningDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned arrival route',
|
||||
example: 'KETAP25L',
|
||||
})
|
||||
arrivalRoute: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned arrival runway',
|
||||
example: '25L',
|
||||
})
|
||||
arrivalRunway: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned route',
|
||||
})
|
||||
plannedRoute: PredictedWaypointDto[];
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'Indicates if the plan is fixed',
|
||||
})
|
||||
fixedPlan: boolean;
|
||||
}
|
||||
49
src/inbound/dto/predictedwaypoint.dto.ts
Normal file
49
src/inbound/dto/predictedwaypoint.dto.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { IsNotEmpty, IsInt, Min, Max } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { WaypointDto } from 'src/generic/dto/waypoint.dto';
|
||||
|
||||
export class PredictedWaypointDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The waypoint',
|
||||
})
|
||||
waypoint: WaypointDto;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned altitude',
|
||||
example: 23000,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(60000)
|
||||
altitude: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned indicated airspeed',
|
||||
example: 200,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(600)
|
||||
indicatedAirspeed: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned groundspeed',
|
||||
example: 500,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(800)
|
||||
groundspeed: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The planned time overhead the waypoint',
|
||||
example: 'Wed, 14 Jun 2017 07:00:00z',
|
||||
})
|
||||
@IsInt()
|
||||
plannedOverheadTime: string;
|
||||
}
|
||||
Reference in New Issue
Block a user