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

ref #56
This commit is contained in:
Nicolai Ort 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; total_scans: number;
/** /**
* The total distance that all runners ran. * The total distance that all runners ran combined.
*/ */
@IsInt() @IsInt()
total_distance: number; total_distance: number;
@ -56,11 +56,20 @@ export class ResponseStats {
total_donation: number; total_donation: number;
/** /**
* The average distance per runner. * The average distance ran per runner.
*/ */
@IsInt() @IsInt()
average_distance: number; 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[]) { public constructor(runners: Runner[], teams: RunnerTeam[], orgs: RunnerOrganisation[], users: User[], scans: Scan[], donations: Donation[]) {
this.total_runners = runners.length; this.total_runners = runners.length;
this.total_teams = teams.length; this.total_teams = teams.length;

View File

@ -35,8 +35,8 @@ export class ResponseStatsOrgnisation {
donationAmount: number; donationAmount: number;
/** /**
* Creates a ResponseRunner object from a runner. * Creates a new organisation stats response from a organisation
* @param runner The user the response shall be build for. * @param org The organisation whoes response shall be generated - the following relations have to be resolved: runners, runners.scans, runners.distanceDonations, runners.scans.track, teams, teams.runners, teams.runners.scans, teams.runners.distanceDonations, teams.runners.scans.track
*/ */
public constructor(org: RunnerOrganisation) { public constructor(org: RunnerOrganisation) {
this.name = org.name; this.name = org.name;

View File

@ -54,8 +54,8 @@ export class ResponseStatsRunner {
group: RunnerGroup; group: RunnerGroup;
/** /**
* Creates a ResponseRunner object from a runner. * Creates a new runner stats response from a runner
* @param runner The user the response shall be build for. * @param runner The runner whoes response shall be generated - the following relations have to be resolved: scans, group, distanceDonations, scans.track
*/ */
public constructor(runner: Runner) { public constructor(runner: Runner) {
this.id = runner.id; this.id = runner.id;

View File

@ -42,8 +42,8 @@ export class ResponseStatsTeam {
parent: RunnerGroup; parent: RunnerGroup;
/** /**
* Creates a ResponseRunner object from a runner. * Creates a new team stats response from a team
* @param runner The user the response shall be build for. * @param team The team whoes response shall be generated - the following relations have to be resolved: runners, runners.scans, runners.distanceDonations, runners.scans.track
*/ */
public constructor(team: RunnerTeam) { public constructor(team: RunnerTeam) {
this.name = team.name; this.name = team.name;