diff --git a/src/models/responses/ResponseStats.ts b/src/models/responses/ResponseStats.ts index 10669c9..55abd1a 100644 --- a/src/models/responses/ResponseStats.ts +++ b/src/models/responses/ResponseStats.ts @@ -58,6 +58,18 @@ export class ResponseStats implements IResponse { @IsInt() total_donation: number; + /** + * The total donation count. + */ + @IsInt() + total_donations: number; + + /** + * The total donor count. + */ + @IsInt() + total_donors: number; + /** * The average distance ran per runner. */ @@ -73,7 +85,7 @@ export class ResponseStats implements IResponse { * @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: number, teams: number, orgs: number, users: number, scans: number, donations: Donation[], distance: number) { + public constructor(runners: number, teams: number, orgs: number, users: number, scans: number, donations: Donation[], distance: number, donors: number) { this.total_runners = runners; this.total_teams = teams; this.total_orgs = orgs; @@ -81,6 +93,8 @@ export class ResponseStats implements IResponse { this.total_scans = scans; this.total_distance = distance; this.total_donation = donations.reduce((sum, current) => sum + current.amount, 0); + this.total_donations = donations.length; + this.total_donors = donors; this.average_distance = this.total_distance / this.total_runners; } }