Fixed manual trackscan creation

ref #78
This commit is contained in:
2021-01-09 14:52:08 +01:00
parent 3ceb5a0c0f
commit 188f26ad65
3 changed files with 22 additions and 27 deletions

View File

@@ -1,8 +1,8 @@
import { IsDateString, IsNotEmpty } from "class-validator";
import { RunnerCard } from '../entities/RunnerCard';
import { ScanStation } from '../entities/ScanStation';
import { TrackScan } from '../entities/TrackScan';
import { ResponseRunnerCard } from './ResponseRunnerCard';
import { ResponseScan } from './ResponseScan';
import { ResponseScanStation } from './ResponseScanStation';
import { ResponseTrack } from './ResponseTrack';
/**
@@ -19,13 +19,13 @@ export class ResponseTrackScan extends ResponseScan {
* The runnerCard associated with the scan.
*/
@IsNotEmpty()
card: RunnerCard;
card: ResponseRunnerCard;
/**
* The scanning station that created the scan.
*/
@IsNotEmpty()
station: ScanStation;
station: ResponseScanStation;
/**
* The scan's creation timestamp.
@@ -41,8 +41,9 @@ export class ResponseTrackScan extends ResponseScan {
public constructor(scan: TrackScan) {
super(scan);
this.track = new ResponseTrack(scan.track);
this.card = scan.card;
this.station = scan.station;
this.card = scan.card.toResponse();
this.station = scan.station.toResponse();
this.timestamp = scan.timestamp;
this.distance = scan.distance;
}
}