Runnerteams now with resolving relations and response types :O

ref #13
This commit is contained in:
2020-12-04 21:38:28 +01:00
parent c53e94d205
commit a437ada3b3
3 changed files with 105 additions and 12 deletions

View File

@@ -0,0 +1,55 @@
import {
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString
} from "class-validator";
import { GroupContact } from '../entities/GroupContact';
import { RunnerGroup } from '../entities/RunnerGroup';
/**
* Defines a track of given length.
*/
export abstract class ResponseRunnerGroup {
/**
* Autogenerated unique id (primary key).
*/
@IsInt()
@IsNotEmpty()
id: number;;
/**
* The groups's name.
*/
@IsString()
@IsNotEmpty()
name: string;
/**
* The group's contact.
* Optional.
*/
@IsObject()
@IsOptional()
contact?: GroupContact;
public constructor(group: RunnerGroup) {
this.id = group.id;
this.name = group.name;
this.contact = group.contact;
}
}