From c080ddb987b002dac24a42e3da94926863039d52 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Mon, 24 Oct 2022 21:23:09 +0200 Subject: [PATCH] add the heading to the inbound structure --- src/inbound/dto/flightstate.dto.ts | 12 +++++++++++- src/inbound/inbound.controller.ts | 1 + src/inbound/models/flightstate.model.ts | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/inbound/dto/flightstate.dto.ts b/src/inbound/dto/flightstate.dto.ts index 8aceadf..39336dd 100644 --- a/src/inbound/dto/flightstate.dto.ts +++ b/src/inbound/dto/flightstate.dto.ts @@ -19,10 +19,20 @@ export class FlightStateDto { @Max(700) groundSpeed: number; + @IsNotEmpty() + @ApiProperty({ + description: 'The reported heading', + example: 200, + }) + @IsInt() + @Min(0) + @Max(360) + heading: number; + @IsNotEmpty() @ApiProperty({ description: 'The reported ground track', - example: 400, + example: 205, }) @IsInt() @Min(0) diff --git a/src/inbound/inbound.controller.ts b/src/inbound/inbound.controller.ts index 0b6b6ce..8ee53df 100644 --- a/src/inbound/inbound.controller.ts +++ b/src/inbound/inbound.controller.ts @@ -87,6 +87,7 @@ export class InboundController { return { position: CoordinateConverter.convert(input.position), groundSpeed: input.groundSpeed, + heading: input.heading, groundTrack: input.groundTrack, altitude: input.altitude, verticalSpeed: input.verticalSpeed, diff --git a/src/inbound/models/flightstate.model.ts b/src/inbound/models/flightstate.model.ts index c4efe17..9d94736 100644 --- a/src/inbound/models/flightstate.model.ts +++ b/src/inbound/models/flightstate.model.ts @@ -21,6 +21,12 @@ export class FlightState { }) groundSpeed: number; + @Prop({ + required: true, + type: Number, + }) + heading: number; + @Prop({ required: true, type: Number,