74 lines
1.1 KiB
TypeScript
74 lines
1.1 KiB
TypeScript
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;
|
|
}
|