22 lines
585 B
TypeScript
22 lines
585 B
TypeScript
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();
|
|
|
|
newRunnerOrganisation.name = this.name;
|
|
|
|
return newRunnerOrganisation;
|
|
}
|
|
} |