Now with working runner orga controller including responses

ref #13
This commit is contained in:
2020-12-04 21:55:09 +01:00
parent a437ada3b3
commit 7b08489533
3 changed files with 79 additions and 26 deletions

View File

@@ -0,0 +1,37 @@
import {
IsArray,
IsNotEmpty,
IsObject
} from "class-validator";
import { Address } from '../entities/Address';
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
import { RunnerTeam } from '../entities/RunnerTeam';
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
/**
* Defines RunnerOrgs's response class.
*/
export class ResponseRunnerOrganisation extends ResponseRunnerGroup {
/**
* The orgs's address.
* Optional.
*/
@IsObject()
@IsNotEmpty()
address?: Address;
/**
* The orgs associated teams.
*/
@IsObject()
@IsArray()
teams: RunnerTeam[];
public constructor(org: RunnerOrganisation) {
super(org);
this.address = org.address;
this.teams = org.teams;
}
}