Implemented group contacts feature/104-contacts #108

Merged
niggl merged 29 commits from feature/104-contacts into dev 2021-01-19 19:08:56 +00:00
Showing only changes of commit 09e429fc67 - Show all commits

View File

@ -1,4 +1,5 @@
import { IsInt, IsString } from "class-validator";
import { IsInt, IsObject, IsString } from "class-validator";
import { Address } from '../entities/Address';
import { GroupContact } from '../entities/GroupContact';
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
@ -45,9 +46,15 @@ export class ResponseGroupContact {
/**
* The contact's associated runner groups.
*/
@IsObject()
groups: ResponseRunnerGroup[];
//TODO: Address
/**
* The contact's address.
* This is a address object to prevent any formatting differences.
*/
@IsObject()
address?: Address;
/**
* Creates a ResponseGroupContact object from a contact.
@ -60,6 +67,7 @@ export class ResponseGroupContact {
this.lastname = contact.lastname;
this.phone = contact.phone;
this.email = contact.email;
this.address = contact.address;
for (let group of contact.groups) {
this.groups.push(group.toResponse());
}