feature/11-new_classes #15

Merged
niggl merged 55 commits from feature/11-new_classes into dev 2020-12-02 17:48:19 +00:00
Showing only changes of commit f350007ae5 - Show all commits

View File

@ -0,0 +1,73 @@
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
import {
IsEmail,
IsInt,
IsNotEmpty,
IsOptional,
IsPhoneNumber,
IsString,
} from "class-validator";
/**
* Defines the participant interface.
*/
export abstract class IParticipant {
/**
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsOptional()
@IsInt()
id: number;
/**
* The participant's first name.
*/
@Column()
@IsNotEmpty()
@IsString()
firstname: string;
/**
* The participant's middle name.
* Optional
*/
@Column()
@IsOptional()
@IsString()
middlename?: string;
/**
* The participant's last name.
*/
@Column()
@IsOptional()
@IsString()
lastname: string;
/**
* The participant's address.
* Optional
*/
@Column()
@IsOptional()
address?: Location;
/**
* The participant's phone number.
* Optional
*/
@Column()
@IsOptional()
@IsPhoneNumber("DE")
phone?: string;
/**
* The participant's email address.
* Optional
*/
@Column()
@IsOptional()
@IsEmail()
email?: string;
}