backend/src/models/responses/ResponseRunnerOrganisation.ts
Nicolai Ort 1e2de7656e
All checks were successful
continuous-integration/drone/pr Build is passing
Reenabled addresses in org responses
ref #68
2021-01-02 20:03:02 +01:00

40 lines
965 B
TypeScript

import {
IsArray,
IsObject,
IsOptional
} from "class-validator";
import { Address } from '../entities/Address';
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
import { RunnerTeam } from '../entities/RunnerTeam';
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
/**
* Defines the runnerOrganisation response.
*/
export class ResponseRunnerOrganisation extends ResponseRunnerGroup {
/**
* The runnerOrganisation's address.
*/
@IsObject()
@IsOptional()
address?: Address;
/**
* The runnerOrganisation associated teams.
*/
@IsArray()
teams: RunnerTeam[];
/**
* Creates a ResponseRunnerOrganisation object from a runnerOrganisation.
* @param org The runnerOrganisation the response shall be build for.
*/
public constructor(org: RunnerOrganisation) {
super(org);
this.address = org.address;
this.teams = org.teams;
}
}