Added comments and decorators for existing create models

ref #13
This commit is contained in:
2020-12-03 20:49:55 +01:00
parent 36b2e82f4e
commit 330cbd5f57
2 changed files with 67 additions and 21 deletions

View File

@@ -1,10 +1,17 @@
import { IsString } from 'class-validator';
import { IsNotEmpty, IsString } from 'class-validator';
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
export class CreateRunnerOrganisation {
/**
* The Organisation's name.
*/
@IsString()
@IsNotEmpty()
name: string;
/**
* Creates a RunnerOrganisation entity from this.
*/
public async toRunnerOrganisation(): Promise<RunnerOrganisation> {
let newRunnerOrganisation: RunnerOrganisation = new RunnerOrganisation();