parent
a2cf8d1f2c
commit
f350007ae5
73
src/models/IParticipant.ts
Normal file
73
src/models/IParticipant.ts
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user