Features for the new selfservice feature/151-selfservice_scans_mails #152

Merged
niggl merged 25 commits from feature/151-selfservice_scans_mails into dev 2021-03-04 16:03:08 +00:00
Showing only changes of commit a2c97a11a3 - Show all commits

View File

@ -1,4 +1,4 @@
import { IsDateString, IsNotEmpty } from "class-validator";
import { IsDateString, IsNotEmpty, IsNumber } from "class-validator";
import { TrackScan } from '../entities/TrackScan';
import { ResponseObjectType } from '../enums/ResponseObjectType';
import { IResponse } from './IResponse';
@ -42,6 +42,13 @@ export class ResponseTrackScan extends ResponseScan implements IResponse {
@IsNotEmpty()
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.
* @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(); }
this.timestamp = scan.timestamp;
this.distance = scan.distance;
this.lapTime = scan.lapTime;
}
}