define the properties as specific as possible

This commit is contained in:
Sven Czarnian
2022-10-22 21:41:38 +02:00
parent 822709f577
commit 5eb83ef649
6 changed files with 90 additions and 36 deletions

View File

@@ -1,24 +1,42 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
import { PerformanceEntry } from './performanceentry.model';
import {
PerformanceEntry,
PerformanceEntrySchema,
} from './performanceentry.model';
export type PerformanceDocument = Performance & Document;
@Schema()
export class Performance {
@Prop({ required: true })
@Prop({
type: String,
required: true,
})
icaoCode: string;
@Prop({ required: true, type: PerformanceEntry })
@Prop({
required: true,
type: PerformanceEntrySchema,
})
aboveFL240: PerformanceEntry;
@Prop({ required: true, type: PerformanceEntry })
@Prop({
required: true,
type: PerformanceEntrySchema,
})
aboveFL100: PerformanceEntry;
@Prop({ required: true, type: PerformanceEntry })
@Prop({
required: true,
type: PerformanceEntrySchema,
})
belowFL100: PerformanceEntry;
@Prop({ required: true })
@Prop({
required: true,
type: Number,
})
minimalApproachSpeed: number;
}