This commit is contained in:
parent
e8f899d098
commit
7eb0ad1221
4 changed files with 30 additions and 27 deletions
|
|
@ -78,28 +78,38 @@ export class Bounds {
|
|||
}
|
||||
export interface ContactOptions {
|
||||
emails?: string[];
|
||||
messages?: Message[];
|
||||
name?: string;
|
||||
phones?: Phone[];
|
||||
uri?: string;
|
||||
}
|
||||
export class Contact {
|
||||
emails: string[];
|
||||
messages: Message[];
|
||||
name: string;
|
||||
phones: Phone[];
|
||||
uri: string;
|
||||
constructor(options?: ContactOptions) {
|
||||
this.emails = options?.emails ?? [];
|
||||
this.messages = options?.messages ?? [];
|
||||
this.name = options?.name ?? "";
|
||||
this.phones = options?.phones ?? [];
|
||||
this.uri = options?.uri ?? "";
|
||||
}
|
||||
static fromJSON(json: ContactDTO): Contact {
|
||||
return new Contact(json);
|
||||
return new Contact({
|
||||
emails: json.emails,
|
||||
messages: json.messages.map((m: MessageDTO) => Message.fromJSON(m)),
|
||||
name: json.name,
|
||||
phones: json.phones,
|
||||
uri: json.uri,
|
||||
});
|
||||
}
|
||||
}
|
||||
export interface ContactDTO {
|
||||
name: string;
|
||||
emails: string[];
|
||||
messages: MessageDTO[];
|
||||
name: string;
|
||||
phones: Phone[];
|
||||
uri: string;
|
||||
}
|
||||
|
|
@ -715,9 +725,9 @@ export interface Site {
|
|||
leads: Lead[];
|
||||
notes: string;
|
||||
organization_id: number;
|
||||
owner?: Contact;
|
||||
owner?: ContactSimple;
|
||||
parcel: Parcel;
|
||||
resident?: Contact;
|
||||
resident?: ContactSimple;
|
||||
resident_owned: boolean;
|
||||
tags: Map<string, string>;
|
||||
version: number;
|
||||
|
|
@ -725,7 +735,7 @@ export interface Site {
|
|||
export interface ReviewTaskPool {
|
||||
condition: string;
|
||||
location: Location;
|
||||
owner: Contact;
|
||||
owner: ContactSimple;
|
||||
site: Site;
|
||||
}
|
||||
export interface ReviewTask {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue