57 lines
1.2 KiB
TypeScript
57 lines
1.2 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 '../../models/waypoint.model';
|
|
|
|
export type AirportDocument = Airport & Document;
|
|
|
|
@Schema()
|
|
export class Airport {
|
|
@Prop({
|
|
required: true,
|
|
index: true,
|
|
type: String,
|
|
})
|
|
icao: string;
|
|
|
|
@Prop({
|
|
required: true,
|
|
type: Waypoint,
|
|
})
|
|
location: Waypoint;
|
|
|
|
@Prop({
|
|
required: true,
|
|
type: Number,
|
|
})
|
|
elevation: number;
|
|
|
|
@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;
|
|
}
|
|
|
|
export const AirportSchema = SchemaFactory.createForClass(Airport);
|