88 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			88 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
 | |
| import { Document } from 'mongoose';
 | |
| import { ArrivalRoute, ArrivalRouteSchema } from './arrivalroute.model';
 | |
| import { Constraint, ConstraintSchema } from './constraint.model';
 | |
| import { Planning, PlanningSchema } from './planning.model';
 | |
| import { RunwaySpacing, RunwaySpacingSchema } from './runwayspacing.model';
 | |
| import { Waypoint } from '../../generic/models/waypoint.model';
 | |
| import { Runway, RunwaySchema } from './runway.model';
 | |
| 
 | |
| export type AirportDocument = Airport & Document;
 | |
| 
 | |
| @Schema()
 | |
| export class Airport {
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     index: true,
 | |
|     type: String,
 | |
|   })
 | |
|   icao: string;
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: String,
 | |
|   })
 | |
|   name: string;
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: String,
 | |
|   })
 | |
|   flightInformationRegion: string;
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: Waypoint,
 | |
|   })
 | |
|   location: Waypoint;
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: Number,
 | |
|   })
 | |
|   elevation: number;
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: [RunwaySchema],
 | |
|   })
 | |
|   runways: Runway[];
 | |
| 
 | |
|   @Prop({
 | |
|     type: [ConstraintSchema],
 | |
|   })
 | |
|   upperConstraints: Constraint[];
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: [ArrivalRouteSchema],
 | |
|   })
 | |
|   arrivalRoutes: ArrivalRoute[];
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     type: [RunwaySpacingSchema],
 | |
|   })
 | |
|   spacings: RunwaySpacing[];
 | |
| 
 | |
|   @Prop({
 | |
|     required: true,
 | |
|     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);
 |