| @@ -1,4 +1,4 @@ | |||||||
| import { IsInt, IsString } from "class-validator"; | import { IsInt, IsOptional, IsString } from "class-validator"; | ||||||
| import { Track } from '../entities/Track'; | import { Track } from '../entities/Track'; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -23,6 +23,14 @@ export class ResponseTrack { | |||||||
|     @IsInt() |     @IsInt() | ||||||
|     distance: number; |     distance: number; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * The minimum time a runner should take to run a lap on this track. | ||||||
|  |      * Will be used for fraud detection. | ||||||
|  |      */ | ||||||
|  |     @IsInt() | ||||||
|  |     @IsOptional() | ||||||
|  |     minimumLapTime?: number; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Creates a ResponseTrack object from a track. |      * Creates a ResponseTrack object from a track. | ||||||
|      * @param track The track the response shall be build for. |      * @param track The track the response shall be build for. | ||||||
| @@ -31,5 +39,6 @@ export class ResponseTrack { | |||||||
|         this.id = track.id; |         this.id = track.id; | ||||||
|         this.name = track.name; |         this.name = track.name; | ||||||
|         this.distance = track.distance; |         this.distance = track.distance; | ||||||
|  |         this.minimumLapTime = track.minimumLapTime; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user