parent
703b4f89a6
commit
09e429fc67
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue