import { IsNotEmpty, IsObject } from "class-validator";
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
import { RunnerTeam } from '../entities/RunnerTeam';
import { ResponseRunnerGroup } from './ResponseRunnerGroup';

/**
 * Defines the runnerTeam response.
*/
export class ResponseRunnerTeam extends ResponseRunnerGroup {

    /**
     * The runnerTeam's parent group (organisation).
     */
    @IsObject()
    @IsNotEmpty()
    parentGroup: RunnerOrganisation;

    /**
     * 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;
    }
}
