Added donation amount to the stats runner response

ref #56
This commit is contained in:
Nicolai Ort 2020-12-30 14:34:10 +01:00
parent a9ecfccfd2
commit 35dbfeb5e7
1 changed files with 7 additions and 0 deletions

View File

@ -40,6 +40,12 @@ export class ResponseStatsRunner {
@IsInt()
distance: number;
/**
* The runner's currently collected donations.
*/
@IsInt()
donationAmount: number;
/**
* The runner's group.
*/
@ -55,6 +61,7 @@ export class ResponseStatsRunner {
this.middlename = runner.middlename;
this.lastname = runner.lastname;
this.distance = runner.scans.filter(scan => { scan.valid === true }).reduce((sum, current) => sum + current.distance, 0);
this.donationAmount = runner.distanceDonationAmount;
this.group = runner.group;
}
}