27 lines
770 B
TypeScript
27 lines
770 B
TypeScript
import { IsNotEmpty, IsObject } from "class-validator";
|
|
import { RunnerTeam } from '../entities/RunnerTeam';
|
|
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
|
|
import { ResponseRunnerOrganisation } from './ResponseRunnerOrganisation';
|
|
|
|
/**
|
|
* Defines the runnerTeam response.
|
|
*/
|
|
export class ResponseRunnerTeam extends ResponseRunnerGroup {
|
|
|
|
/**
|
|
* The runnerTeam's parent group (organisation).
|
|
*/
|
|
@IsObject()
|
|
@IsNotEmpty()
|
|
parentGroup: ResponseRunnerOrganisation;
|
|
|
|
/**
|
|
* Creates a ResponseRunnerTeam object from a runnerTeam.
|
|
* @param team The team the response shall be build for.
|
|
*/
|
|
public constructor(team: RunnerTeam) {
|
|
super(team);
|
|
this.parentGroup = team.parentGroup.toResponse();
|
|
}
|
|
}
|