Renamed files and classed from *Organisation* to *Organization*📝
ref #117
This commit is contained in:
47
src/models/responses/ResponseStatsOrganization.ts
Normal file
47
src/models/responses/ResponseStatsOrganization.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
IsInt,
|
||||
|
||||
IsString
|
||||
} from "class-validator";
|
||||
import { RunnerOrganization } from '../entities/RunnerOrganization';
|
||||
|
||||
/**
|
||||
* Defines the org stats response.
|
||||
* This differs from the normal org responce.
|
||||
*/
|
||||
export class ResponseStatsOrgnisation {
|
||||
/**
|
||||
* The orgs's id.
|
||||
*/
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* The orgs's name.
|
||||
*/
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The orgs's runner's currently ran distance in meters.
|
||||
*/
|
||||
@IsInt()
|
||||
distance: number;
|
||||
|
||||
/**
|
||||
* The orgs's currently collected donations.
|
||||
*/
|
||||
@IsInt()
|
||||
donationAmount: number;
|
||||
|
||||
/**
|
||||
* Creates a new organization stats response from a organization
|
||||
* @param org The organization 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: RunnerOrganization) {
|
||||
this.name = org.name;
|
||||
this.id = org.id;
|
||||
this.distance = org.distance;
|
||||
this.donationAmount = org.distanceDonationAmount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user