From c17d79d16cf7aa2e1a7a8c098dec9ee9cc6567d2 Mon Sep 17 00:00:00 2001 From: "Kevin C. Coram" Date: Sat, 7 Sep 2019 21:32:50 -0400 Subject: [PATCH] Update model interfaces to require all attributes --- libs/contact/src/lib/contact-model.ts | 24 +++++++++---------- .../src/lib/services/contact.service.ts | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libs/contact/src/lib/contact-model.ts b/libs/contact/src/lib/contact-model.ts index df754da..1be95b7 100644 --- a/libs/contact/src/lib/contact-model.ts +++ b/libs/contact/src/lib/contact-model.ts @@ -1,20 +1,20 @@ export interface Name { - firstName?: string; - lastName?: string; - middleName?: string; - prefix?: string; - suffix?: string; + firstName: string; + lastName: string; + middleName: string; + prefix: string; + suffix: string; } export interface Address { - line_1?: string; - line_2?: string; - city?: string; - state?: string; - postalCode?: string; + line_1: string; + line_2: string; + city: string; + state: string; + postalCode: string; } export interface Contact { - name?: Name; - addresses?: Address[]; + name: Name; + addresses: Address[]; } diff --git a/libs/contact/src/lib/services/contact.service.ts b/libs/contact/src/lib/services/contact.service.ts index 04269c4..282a559 100644 --- a/libs/contact/src/lib/services/contact.service.ts +++ b/libs/contact/src/lib/services/contact.service.ts @@ -14,12 +14,14 @@ const contact: Contact = { addresses: [ { line_1: '123 Main Street', + line_2: null, city: 'New York', state: 'NY', postalCode: '12345', }, { line_1: '123 South Street', + line_2: null, city: 'Boston', state: 'MA', postalCode: '54321',