Added some comments
All checks were successful
continuous-integration/drone/pr Build is passing

ref #56
This commit is contained in:
2020-12-30 17:27:24 +01:00
parent 5d31d8d1a2
commit e0fa58da57
4 changed files with 17 additions and 8 deletions

View File

@@ -44,7 +44,7 @@ export class ResponseStats {
total_scans: number;
/**
* The total distance that all runners ran.
* The total distance that all runners ran combined.
*/
@IsInt()
total_distance: number;
@@ -56,11 +56,20 @@ export class ResponseStats {
total_donation: number;
/**
* The average distance per runner.
* The average distance ran per runner.
*/
@IsInt()
average_distance: number;
/**
* Creates a new stats response containing some basic statistics for a dashboard or public display.
* @param runners Array containing all runners - the following relations have to be resolved: scans, scans.track
* @param teams Array containing all teams - no relations have to be resolved.
* @param orgs Array containing all orgs - no relations have to be resolved.
* @param users Array containing all users - no relations have to be resolved.
* @param scans Array containing all scans - no relations have to be resolved.
* @param donations Array containing all donations - the following relations have to be resolved: runner, runner.scans, runner.scans.track
*/
public constructor(runners: Runner[], teams: RunnerTeam[], orgs: RunnerOrganisation[], users: User[], scans: Scan[], donations: Donation[]) {
this.total_runners = runners.length;
this.total_teams = teams.length;