From f999c416c4367ddbb99fe19e443c1ce4867f5053 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 1 Dec 2020 17:27:18 +0100 Subject: [PATCH] Added Runnergroup abstract class ref #11 --- src/models/RunnerGroup.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/models/RunnerGroup.ts diff --git a/src/models/RunnerGroup.ts b/src/models/RunnerGroup.ts new file mode 100644 index 0000000..d5223bb --- /dev/null +++ b/src/models/RunnerGroup.ts @@ -0,0 +1,38 @@ +import { Entity, PrimaryGeneratedColumn, Column } from "typeorm"; +import { + IsEmail, + IsInt, + IsNotEmpty, + IsOptional, + IsPhoneNumber, + IsString, +} from "class-validator"; + +/** + * Defines the runnerGroup interface. +*/ +export abstract class RunnerGroup { + /** + * Autogenerated unique id (primary key). + */ + @PrimaryGeneratedColumn() + @IsOptional() + @IsInt() + id: number; + + /** + * The group's first name. + */ + @Column() + @IsNotEmpty() + @IsString() + name: string; + + /** + * The participant's middle name. + * Optional + */ + @Column() + @IsOptional() + contact?: GroupContact; +} \ No newline at end of file