parent
aa833736d3
commit
a2c97a11a3
@ -1,4 +1,4 @@
|
|||||||
import { IsDateString, IsNotEmpty } from "class-validator";
|
import { IsDateString, IsNotEmpty, IsNumber } from "class-validator";
|
||||||
import { TrackScan } from '../entities/TrackScan';
|
import { TrackScan } from '../entities/TrackScan';
|
||||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
||||||
import { IResponse } from './IResponse';
|
import { IResponse } from './IResponse';
|
||||||
@ -42,6 +42,13 @@ export class ResponseTrackScan extends ResponseScan implements IResponse {
|
|||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The scan's lap time.
|
||||||
|
* This simply get's calculated from the last lap time;
|
||||||
|
*/
|
||||||
|
@IsNumber()
|
||||||
|
lapTime: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a ResponseTrackScan object from a scan.
|
* Creates a ResponseTrackScan object from a scan.
|
||||||
* @param scan The trackSscan the response shall be build for.
|
* @param scan The trackSscan the response shall be build for.
|
||||||
@ -53,5 +60,6 @@ export class ResponseTrackScan extends ResponseScan implements IResponse {
|
|||||||
if (scan.station) { scan.station.toResponse(); }
|
if (scan.station) { scan.station.toResponse(); }
|
||||||
this.timestamp = scan.timestamp;
|
this.timestamp = scan.timestamp;
|
||||||
this.distance = scan.distance;
|
this.distance = scan.distance;
|
||||||
|
this.lapTime = scan.lapTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user