Explorar o código

add active runways and the arrival mode

Sven Czarnian %!s(int64=2) %!d(string=hai) anos
pai
achega
e32292e509

+ 4 - 0
src/airport/airport.controller.ts

@@ -140,6 +140,8 @@ export class AirportController {
       planning: AirportController.convertPlanning<PlanningDto, AssignmentDto>(
         airport.planning,
       ),
+      activeRunways: airport.activeRunways,
+      arrivalMode: airport.arrivalMode,
     };
   }
 
@@ -167,6 +169,8 @@ export class AirportController {
       planning: AirportController.convertPlanning<Planning, Assignment>(
         airport.planning,
       ),
+      activeRunways: airport.activeRunways,
+      arrivalMode: airport.arrivalMode,
     };
   }
 

+ 14 - 0
src/airport/dto/airport.dto.ts

@@ -49,4 +49,18 @@ export class AirportDto {
     description: 'The planning configuration',
   })
   planning: PlanningDto;
+
+  @IsOptional()
+  @ApiProperty({
+    description: 'The currently active runways',
+    example: '["25L", "25R"]',
+  })
+  activeRunways: string[];
+
+  @IsOptional()
+  @ApiProperty({
+    description: 'The active arrival mode',
+    example: 'STAGGERED',
+  })
+  arrivalMode: string;
 }

+ 12 - 0
src/airport/models/airport.model.ts

@@ -51,6 +51,18 @@ export class Airport {
     type: PlanningSchema,
   })
   planning: Planning;
+
+  @Prop({
+    type: [String],
+  })
+  activeRunways: string[];
+
+  @Prop({
+    enum: ['STAGGERED', 'IPA'],
+    default: 'STAGGERED',
+    type: String,
+  })
+  arrivalMode: string;
 }
 
 export const AirportSchema = SchemaFactory.createForClass(Airport);