@@ -1,8 +1,13 @@
|
||||
import {
|
||||
IsArray,
|
||||
|
||||
IsBase64,
|
||||
|
||||
IsBoolean,
|
||||
|
||||
IsObject,
|
||||
IsOptional
|
||||
IsOptional,
|
||||
IsString
|
||||
} from "class-validator";
|
||||
import { Address } from '../entities/Address';
|
||||
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
|
||||
@@ -27,6 +32,22 @@ export class ResponseRunnerOrganisation extends ResponseRunnerGroup {
|
||||
@IsArray()
|
||||
teams: RunnerTeam[];
|
||||
|
||||
/**
|
||||
* The organisation's registration key.
|
||||
* If registration is disabled this is null.
|
||||
*/
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@IsBase64()
|
||||
registrationKey?: string;
|
||||
|
||||
/**
|
||||
* Is registration enabled for the organisation?
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
registrtionEnabled?: boolean = true;
|
||||
|
||||
/**
|
||||
* Creates a ResponseRunnerOrganisation object from a runnerOrganisation.
|
||||
* @param org The runnerOrganisation the response shall be build for.
|
||||
@@ -35,5 +56,7 @@ export class ResponseRunnerOrganisation extends ResponseRunnerGroup {
|
||||
super(org);
|
||||
this.address = org.address;
|
||||
this.teams = org.teams;
|
||||
if (!org.key) { this.registrtionEnabled = false; }
|
||||
else { this.registrationKey = Buffer.from(org.key).toString('base64'); }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user