Code + comment cleanup for the response models

ref #39
This commit is contained in:
2020-12-20 19:38:22 +01:00
parent a85d52437b
commit 75332983c2
13 changed files with 83 additions and 91 deletions

View File

@@ -1,18 +1,12 @@
import {
IsInt,
IsString
} from "class-validator";
import { IsInt, IsString } from "class-validator";
import { Participant } from '../entities/Participant';
/**
* Defines a participant response.
* Defines the participant response.
*/
export abstract class ResponseParticipant {
/**
* Autogenerated unique id (primary key).
* The participant's id.
*/
@IsInt()
id: number;
@@ -25,7 +19,6 @@ export abstract class ResponseParticipant {
/**
* The participant's middle name.
* Optional.
*/
@IsString()
middlename?: string;
@@ -38,18 +31,20 @@ export abstract class ResponseParticipant {
/**
* The participant's phone number.
* Optional.
*/
@IsString()
phone?: string;
/**
* The participant's e-mail address.
* Optional.
*/
@IsString()
email?: string;
/**
* Creates a ResponseParticipant object from a participant.
* @param participant The participant the response shall be build for.
*/
public constructor(participant: Participant) {
this.id = participant.id;
this.firstname = participant.firstname;