introduce the database and controller connections for all inbounds
This commit is contained in:
42
src/inbound/models/aircraft.model.ts
Normal file
42
src/inbound/models/aircraft.model.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
|
||||
export type AircraftDocument = Aircraft & Document;
|
||||
|
||||
@Schema()
|
||||
export class Aircraft {
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
enum: ['L', 'M', 'H', 'S'],
|
||||
})
|
||||
wtc: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
enum: ['A', 'B', 'C', 'D', 'E', 'F'],
|
||||
})
|
||||
wakeRecat: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
engineCount: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
enum: ['ELECTRIC', 'TURBOPROP', 'JET'],
|
||||
})
|
||||
engineType: string;
|
||||
}
|
||||
|
||||
export const AircraftSchema = SchemaFactory.createForClass(Aircraft);
|
||||
32
src/inbound/models/controllerinput.model.ts
Normal file
32
src/inbound/models/controllerinput.model.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
import { Waypoint, WaypointSchema } from 'src/generic/models/waypoint.model';
|
||||
|
||||
export type ControllerInputDocument = ControllerInput & Document;
|
||||
|
||||
@Schema()
|
||||
export class ControllerInput {
|
||||
@Prop({
|
||||
type: String,
|
||||
})
|
||||
reportedTime: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: [WaypointSchema],
|
||||
})
|
||||
remainingRoute: Waypoint[];
|
||||
|
||||
@Prop({
|
||||
type: String,
|
||||
})
|
||||
requestedRunway: string;
|
||||
|
||||
@Prop({
|
||||
type: String,
|
||||
})
|
||||
plannedStand: string;
|
||||
}
|
||||
|
||||
export const ControllerInputSchema =
|
||||
SchemaFactory.createForClass(ControllerInput);
|
||||
43
src/inbound/models/flightstate.model.ts
Normal file
43
src/inbound/models/flightstate.model.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
import {
|
||||
Coordinate,
|
||||
CoordinateSchema,
|
||||
} from '../../generic/models/coordinate.model';
|
||||
|
||||
export type FlightStateDocument = FlightState & Document;
|
||||
|
||||
@Schema()
|
||||
export class FlightState {
|
||||
@Prop({
|
||||
required: true,
|
||||
type: CoordinateSchema,
|
||||
})
|
||||
position: Coordinate;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
groundSpeed: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
groundTrack: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
altitude: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
verticalSpeed: number;
|
||||
}
|
||||
|
||||
export const FlightStateSchema = SchemaFactory.createForClass(FlightState);
|
||||
59
src/inbound/models/inbound.model.ts
Normal file
59
src/inbound/models/inbound.model.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
import { Aircraft, AircraftSchema } from './aircraft.model';
|
||||
import {
|
||||
ControllerInput,
|
||||
ControllerInputSchema,
|
||||
} from './controllerinput.model';
|
||||
import { FlightState, FlightStateSchema } from './flightstate.model';
|
||||
import { Planning, PlanningSchema } from './planning.model';
|
||||
|
||||
export type InboundDocument = Inbound & Document;
|
||||
|
||||
@Schema()
|
||||
export class Inbound {
|
||||
@Prop({
|
||||
required: true,
|
||||
index: true,
|
||||
type: String,
|
||||
})
|
||||
callsign: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
index: true,
|
||||
type: String,
|
||||
})
|
||||
destination: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
enum: ['UNK', 'DEL', 'GRD', 'TWR', 'APP', 'DEP', 'CTR'],
|
||||
})
|
||||
reporter: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: AircraftSchema,
|
||||
})
|
||||
aircraft: Aircraft;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: FlightStateSchema,
|
||||
})
|
||||
flightState: FlightState;
|
||||
|
||||
@Prop({
|
||||
type: ControllerInputSchema,
|
||||
})
|
||||
controllerData: ControllerInput;
|
||||
|
||||
@Prop({
|
||||
type: PlanningSchema,
|
||||
})
|
||||
plan: Planning;
|
||||
}
|
||||
|
||||
export const InboundSchema = SchemaFactory.createForClass(Inbound);
|
||||
37
src/inbound/models/planning.model.ts
Normal file
37
src/inbound/models/planning.model.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
import {
|
||||
PredictedWaypoint,
|
||||
PredictedWaypointSchema,
|
||||
} from './predictedwaypoint.model';
|
||||
|
||||
export type PlanningDocument = Planning & Document;
|
||||
|
||||
@Schema()
|
||||
export class Planning {
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
})
|
||||
arrivalRoute: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
})
|
||||
arrivalRunway: string;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: [PredictedWaypointSchema],
|
||||
})
|
||||
plannedRoute: PredictedWaypoint[];
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Boolean,
|
||||
})
|
||||
fixedPlan: boolean;
|
||||
}
|
||||
|
||||
export const PlanningSchema = SchemaFactory.createForClass(Planning);
|
||||
41
src/inbound/models/predictedwaypoint.model.ts
Normal file
41
src/inbound/models/predictedwaypoint.model.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
import { Waypoint, WaypointSchema } from '../../generic/models/waypoint.model';
|
||||
|
||||
export type PredictedWaypointDocument = PredictedWaypoint & Document;
|
||||
|
||||
@Schema()
|
||||
export class PredictedWaypoint {
|
||||
@Prop({
|
||||
required: true,
|
||||
type: WaypointSchema,
|
||||
})
|
||||
waypoint: Waypoint;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
altitude: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
indicatedAirspeed: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: Number,
|
||||
})
|
||||
groundspeed: number;
|
||||
|
||||
@Prop({
|
||||
required: true,
|
||||
type: String,
|
||||
})
|
||||
plannedOverheadTime: string;
|
||||
}
|
||||
|
||||
export const PredictedWaypointSchema =
|
||||
SchemaFactory.createForClass(PredictedWaypoint);
|
||||
Reference in New Issue
Block a user