From dafac06bc84d1b237096a561b3adcd3ca5cb1dd8 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 16 Jan 2021 16:53:18 +0100 Subject: [PATCH] Updated the responseclasses to use the new address implementation ref #105 --- src/models/responses/ResponseParticipant.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/models/responses/ResponseParticipant.ts b/src/models/responses/ResponseParticipant.ts index 148bcff..93a6918 100644 --- a/src/models/responses/ResponseParticipant.ts +++ b/src/models/responses/ResponseParticipant.ts @@ -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; } }