Updated the responseclasses to use the new address implementation

ref #105
This commit is contained in:
Nicolai Ort 2021-01-16 16:53:18 +01:00
parent e2651728c5
commit dafac06bc8
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { IsInt, IsString } from "class-validator";
import { IsInt, IsObject, IsOptional, IsString } from "class-validator";
import { Address } from '../entities/Address';
import { Participant } from '../entities/Participant';
/**
@ -41,6 +42,13 @@ export abstract class ResponseParticipant {
@IsString()
email?: string;
/**
* The participant's address.
*/
@IsOptional()
@IsObject()
address?: Address;
/**
* Creates a ResponseParticipant object from a participant.
* @param participant The participant the response shall be build for.
@ -52,5 +60,6 @@ export abstract class ResponseParticipant {
this.lastname = participant.lastname;
this.phone = participant.phone;
this.email = participant.email;
this.address = participant.address;
}
}