diff --git a/src/models/actions/CreateTrack.ts b/src/models/actions/CreateTrack.ts index f04e55b..c4dde39 100644 --- a/src/models/actions/CreateTrack.ts +++ b/src/models/actions/CreateTrack.ts @@ -1,4 +1,4 @@ -import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator'; +import { IsInt, IsNotEmpty, IsOptional, IsPositive, IsString } from 'class-validator'; import { Track } from '../entities/Track'; /** @@ -19,6 +19,15 @@ export class CreateTrack { @IsPositive() distance: number; + /** + * The minimum time a runner should take to run a lap on this track. + * Will be used for fraud detection. + */ + @IsInt() + @IsOptional() + @IsPositive() + minimumLapTime?: number; + /** * Creates a new Track entity from this. */ @@ -27,6 +36,7 @@ export class CreateTrack { newTrack.name = this.name; newTrack.distance = this.distance; + newTrack.minimumLapTime = this.minimumLapTime; return newTrack; }