Code + comment cleanup for the response models

ref #39
This commit is contained in:
2020-12-20 19:38:22 +01:00
parent a85d52437b
commit 75332983c2
13 changed files with 83 additions and 91 deletions

View File

@@ -1,38 +1,20 @@
import {
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString
} from "class-validator";
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.
* Defines the runnerGroup response.
*/
export abstract class ResponseRunnerGroup {
/**
* Autogenerated unique id (primary key).
* The runnerGroup's id.
*/
@IsInt()
@IsNotEmpty()
id: number;;
/**
* The groups's name.
* The runnerGroup's name.
*/
@IsString()
@IsNotEmpty()
@@ -40,13 +22,16 @@ export abstract class ResponseRunnerGroup {
/**
* The group's contact.
* Optional.
* The runnerGroup's contact.
*/
@IsObject()
@IsOptional()
contact?: GroupContact;
/**
* Creates a ResponseRunnerGroup object from a runnerGroup.
* @param group The runnerGroup the response shall be build for.
*/
public constructor(group: RunnerGroup) {
this.id = group.id;
this.name = group.name;