parent
3c11d88557
commit
ba396e0eba
|
@ -0,0 +1,36 @@
|
|||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
import { RunnerTeam } from '../entities/RunnerTeam';
|
||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
||||
import { IResponse } from './IResponse';
|
||||
|
||||
/**
|
||||
* Defines the runner selfservice team response.
|
||||
* Why? B/C runner's are not allowed to view all information available to admin users.
|
||||
*/
|
||||
export class ResponseSelfServiceTeam implements IResponse {
|
||||
/**
|
||||
* The responseType.
|
||||
* This contains the type of class/entity this response contains.
|
||||
*/
|
||||
responseType: ResponseObjectType = ResponseObjectType.SELFSERVICETEAM;
|
||||
|
||||
/**
|
||||
* The team's name.
|
||||
*/
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The team's id.
|
||||
* Will be used to insert runners it into that team.
|
||||
*/
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
id: number;
|
||||
|
||||
public constructor(team: RunnerTeam) {
|
||||
this.name = team.name;
|
||||
this.id = team.id;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue