@@ -1,9 +1,18 @@
 | 
			
		||||
import { IsInt, IsString } from 'class-validator';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the repsonse auth.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseAuth {
 | 
			
		||||
export class ResponseAuth implements IResponse {
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
  responseType: ResponseObjectType = ResponseObjectType.AUTH;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
  * The access_token - JWT shortterm access token.
 | 
			
		||||
  */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,19 @@
 | 
			
		||||
import { IsInt, IsObject, IsPositive } from 'class-validator';
 | 
			
		||||
import { DistanceDonation } from '../entities/DistanceDonation';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseDonation } from './ResponseDonation';
 | 
			
		||||
import { ResponseRunner } from './ResponseRunner';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the distance donation response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseDistanceDonation extends ResponseDonation {
 | 
			
		||||
export class ResponseDistanceDonation extends ResponseDonation implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
     * The responseType.
 | 
			
		||||
     * This contains the type of class/entity this response contains.
 | 
			
		||||
     */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.DISTANCEDONATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The donation's associated runner.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,20 @@
 | 
			
		||||
import { IsInt, IsNotEmpty, IsPositive } from "class-validator";
 | 
			
		||||
import { Donation } from '../entities/Donation';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseDonor } from './ResponseDonor';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the donation response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseDonation {
 | 
			
		||||
export class ResponseDonation implements IResponse {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.DONATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The donation's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -2,12 +2,19 @@ import {
 | 
			
		||||
    IsBoolean, IsInt
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { Donor } from '../entities/Donor';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseParticipant } from './ResponseParticipant';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the donor response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseDonor extends ResponseParticipant {
 | 
			
		||||
export class ResponseDonor extends ResponseParticipant implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.DONOR;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Does this donor need a receipt?
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,17 @@
 | 
			
		||||
import { IsString } from 'class-validator';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines a empty response object.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseEmpty {
 | 
			
		||||
export class ResponseEmpty implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.EMPTY;
 | 
			
		||||
 | 
			
		||||
    @IsString()
 | 
			
		||||
    response: string = "nothing here"
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,20 @@
 | 
			
		||||
import { IsInt, IsObject, IsString } from "class-validator";
 | 
			
		||||
import { Address } from '../entities/Address';
 | 
			
		||||
import { GroupContact } from '../entities/GroupContact';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the group contact response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseGroupContact {
 | 
			
		||||
export class ResponseGroupContact implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.GROUPCONTACT;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The contact's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,17 @@
 | 
			
		||||
import { IsString } from 'class-validator';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the logout response.
 | 
			
		||||
*/
 | 
			
		||||
export class Logout {
 | 
			
		||||
export class Logout implements IResponse {
 | 
			
		||||
  /**
 | 
			
		||||
   * The responseType.
 | 
			
		||||
   * This contains the type of class/entity this response contains.
 | 
			
		||||
   */
 | 
			
		||||
  responseType: ResponseObjectType = ResponseObjectType.LOGOUT;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
  * The logout's timestamp.
 | 
			
		||||
  */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsInt, IsObject, IsOptional, IsString } from "class-validator";
 | 
			
		||||
import { Address } from '../entities/Address';
 | 
			
		||||
import { Participant } from '../entities/Participant';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the participant response.
 | 
			
		||||
*/
 | 
			
		||||
export abstract class ResponseParticipant {
 | 
			
		||||
export abstract class ResponseParticipant implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.PARTICIPANT;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The participant's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,20 @@ import {
 | 
			
		||||
import { Permission } from '../entities/Permission';
 | 
			
		||||
import { PermissionAction } from '../enums/PermissionAction';
 | 
			
		||||
import { PermissionTarget } from '../enums/PermissionTargets';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponsePrincipal } from './ResponsePrincipal';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the permission response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponsePermission {
 | 
			
		||||
export class ResponsePermission implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.PERMISSION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The permission's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -2,11 +2,19 @@ import {
 | 
			
		||||
    IsInt
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { Principal } from '../entities/Principal';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the principal response.
 | 
			
		||||
*/
 | 
			
		||||
export abstract class ResponsePrincipal {
 | 
			
		||||
export abstract class ResponsePrincipal implements IResponse {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.PRINCIPAL;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The principal's id.
 | 
			
		||||
 
 | 
			
		||||
@@ -4,12 +4,19 @@ import {
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { Runner } from '../entities/Runner';
 | 
			
		||||
import { RunnerGroup } from '../entities/RunnerGroup';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseParticipant } from './ResponseParticipant';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runner response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseRunner extends ResponseParticipant {
 | 
			
		||||
export class ResponseRunner extends ResponseParticipant implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.RUNNER;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runner's currently ran distance in meters.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsBoolean, IsEAN, IsInt, IsNotEmpty, IsObject, IsString } from "class-validator";
 | 
			
		||||
import { RunnerCard } from '../entities/RunnerCard';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunner } from './ResponseRunner';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runner card response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseRunnerCard {
 | 
			
		||||
export class ResponseRunnerCard implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.RUNNERCARD;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The card's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsInt, IsNotEmpty, IsObject, IsOptional, IsString } from "class-validator";
 | 
			
		||||
import { GroupContact } from '../entities/GroupContact';
 | 
			
		||||
import { RunnerGroup } from '../entities/RunnerGroup';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runnerGroup response.
 | 
			
		||||
*/
 | 
			
		||||
export abstract class ResponseRunnerGroup {
 | 
			
		||||
export abstract class ResponseRunnerGroup implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.RUNNERGROUP;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runnerGroup's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -12,12 +12,19 @@ import {
 | 
			
		||||
import { Address } from '../entities/Address';
 | 
			
		||||
import { RunnerOrganization } from '../entities/RunnerOrganization';
 | 
			
		||||
import { RunnerTeam } from '../entities/RunnerTeam';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runnerOrganization response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseRunnerOrganization extends ResponseRunnerGroup {
 | 
			
		||||
export class ResponseRunnerOrganization extends ResponseRunnerGroup implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.RUNNERORGANIZATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runnerOrganization's address.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,19 @@
 | 
			
		||||
import { IsNotEmpty, IsObject } from "class-validator";
 | 
			
		||||
import { RunnerTeam } from '../entities/RunnerTeam';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
 | 
			
		||||
import { ResponseRunnerOrganization } from './ResponseRunnerOrganization';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runnerTeam response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseRunnerTeam extends ResponseRunnerGroup {
 | 
			
		||||
export class ResponseRunnerTeam extends ResponseRunnerGroup implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.RUNNERTEAM;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runnerTeam's parent group (organization).
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsBoolean, IsInt, IsNotEmpty, IsPositive } from "class-validator";
 | 
			
		||||
import { Scan } from '../entities/Scan';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunner } from './ResponseRunner';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the scan response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseScan {
 | 
			
		||||
export class ResponseScan implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.SCAN;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The scans's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -11,12 +11,20 @@ import {
 | 
			
		||||
    IsString
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { ScanStation } from '../entities/ScanStation';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseTrack } from './ResponseTrack';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the statsClient response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseScanStation {
 | 
			
		||||
export class ResponseScanStation implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.SCANSTATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The client's id.
 | 
			
		||||
     */
 | 
			
		||||
@@ -64,7 +72,7 @@ export class ResponseScanStation {
 | 
			
		||||
        this.description = station.description;
 | 
			
		||||
        this.prefix = station.prefix;
 | 
			
		||||
        this.key = "Only visible on creation.";
 | 
			
		||||
        this.track = station.track;
 | 
			
		||||
        this.track = station.track.toResponse();
 | 
			
		||||
        this.enabled = station.enabled;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsInt, IsNotEmpty, IsPositive } from 'class-validator';
 | 
			
		||||
import { DistanceDonation } from '../entities/DistanceDonation';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runner selfservice donation response.
 | 
			
		||||
 * Why? B/C runner's are not allowed to view all information available to admin users.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseSelfServiceDonation {
 | 
			
		||||
export class ResponseSelfServiceDonation implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.SELFSERVICEDONATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The donation's donor.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,8 @@ import { DistanceDonation } from '../entities/DistanceDonation';
 | 
			
		||||
import { Runner } from '../entities/Runner';
 | 
			
		||||
import { RunnerGroup } from '../entities/RunnerGroup';
 | 
			
		||||
import { RunnerTeam } from '../entities/RunnerTeam';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseParticipant } from './ResponseParticipant';
 | 
			
		||||
import { ResponseSelfServiceDonation } from './ResponseSelfServiceDonation';
 | 
			
		||||
 | 
			
		||||
@@ -10,7 +12,12 @@ import { ResponseSelfServiceDonation } from './ResponseSelfServiceDonation';
 | 
			
		||||
 * Defines the runner selfservice response.
 | 
			
		||||
 * Why? B/C runner's are not allowed to view all information available to admin users.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseSelfServiceRunner extends ResponseParticipant {
 | 
			
		||||
export class ResponseSelfServiceRunner extends ResponseParticipant implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.SELFSERVICERUNNER;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runner's currently ran distance in meters.
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,20 @@ import { RunnerOrganization } from '../entities/RunnerOrganization';
 | 
			
		||||
import { RunnerTeam } from '../entities/RunnerTeam';
 | 
			
		||||
import { Scan } from '../entities/Scan';
 | 
			
		||||
import { User } from '../entities/User';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the stats response.
 | 
			
		||||
 * The stats response calculates some basic stats for a dashboard or public display.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseStats {
 | 
			
		||||
export class ResponseStats implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.STATS;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The amount of runners registered in the system.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -8,11 +8,19 @@ import {
 | 
			
		||||
    IsString
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { StatsClient } from '../entities/StatsClient';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the statsClient response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseStatsClient {
 | 
			
		||||
export class ResponseStatsClient implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.STATSCLIENT;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The client's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -4,12 +4,20 @@ import {
 | 
			
		||||
    IsString
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { RunnerOrganization } from '../entities/RunnerOrganization';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the org stats response.
 | 
			
		||||
 * This differs from the normal org responce.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseStatsOrgnisation {
 | 
			
		||||
export class ResponseStatsOrgnisation implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.STATSORGANIZATION;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The orgs's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -5,12 +5,20 @@ import {
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { Runner } from '../entities/Runner';
 | 
			
		||||
import { RunnerGroup } from '../entities/RunnerGroup';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the runner stats response.
 | 
			
		||||
 * This differs from the normal runner responce.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseStatsRunner {
 | 
			
		||||
export class ResponseStatsRunner implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.STATSRUNNER;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The runner's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -5,12 +5,20 @@ import {
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { RunnerGroup } from '../entities/RunnerGroup';
 | 
			
		||||
import { RunnerTeam } from '../entities/RunnerTeam';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the team stats response.
 | 
			
		||||
 * This differs from the normal team responce.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseStatsTeam {
 | 
			
		||||
export class ResponseStatsTeam implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.STATSTEAM;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The team's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,19 @@
 | 
			
		||||
import { IsInt, IsOptional, IsString } from "class-validator";
 | 
			
		||||
import { TrackLapTimeCantBeNegativeError } from '../../errors/TrackErrors';
 | 
			
		||||
import { Track } from '../entities/Track';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the track response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseTrack {
 | 
			
		||||
export class ResponseTrack implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.TRACK;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The track's id.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
import { IsDateString, IsNotEmpty } from "class-validator";
 | 
			
		||||
import { TrackScan } from '../entities/TrackScan';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponseRunnerCard } from './ResponseRunnerCard';
 | 
			
		||||
import { ResponseScan } from './ResponseScan';
 | 
			
		||||
import { ResponseScanStation } from './ResponseScanStation';
 | 
			
		||||
@@ -8,10 +10,16 @@ import { ResponseTrack } from './ResponseTrack';
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the trackScan response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseTrackScan extends ResponseScan {
 | 
			
		||||
export class ResponseTrackScan extends ResponseScan implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
   * The scan's associated track.
 | 
			
		||||
   */
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.TRACKSCAN;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The scan's associated track.
 | 
			
		||||
     */
 | 
			
		||||
    @IsNotEmpty()
 | 
			
		||||
    track: ResponseTrack;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,20 @@ import {
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { User } from '../entities/User';
 | 
			
		||||
import { UserGroup } from '../entities/UserGroup';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponsePrincipal } from './ResponsePrincipal';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the user response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseUser extends ResponsePrincipal {
 | 
			
		||||
export class ResponseUser extends ResponsePrincipal implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.USER;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The user's first name.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,20 @@
 | 
			
		||||
import { IsArray, IsNotEmpty, IsOptional, IsString } from "class-validator";
 | 
			
		||||
import { Permission } from '../entities/Permission';
 | 
			
		||||
import { UserGroup } from '../entities/UserGroup';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponsePrincipal } from './ResponsePrincipal';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the userGroup response.
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseUserGroup extends ResponsePrincipal {
 | 
			
		||||
export class ResponseUserGroup extends ResponsePrincipal implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.USERGROUP;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The userGroup's name.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -5,12 +5,20 @@ import {
 | 
			
		||||
    IsOptional
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { User } from '../entities/User';
 | 
			
		||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
 | 
			
		||||
import { IResponse } from './IResponse';
 | 
			
		||||
import { ResponsePermission } from './ResponsePermission';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the user permission response (get /api/users/:id/permissions).
 | 
			
		||||
*/
 | 
			
		||||
export class ResponseUserPermissions {
 | 
			
		||||
export class ResponseUserPermissions implements IResponse {
 | 
			
		||||
    /**
 | 
			
		||||
    * The responseType.
 | 
			
		||||
    * This contains the type of class/entity this response contains.
 | 
			
		||||
    */
 | 
			
		||||
    responseType: ResponseObjectType = ResponseObjectType.USERPERMISSIONS;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The permissions directly granted to the user.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user