@star-insure/sdk 0.1.1 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/types/api/enums.d.ts +1 -0
  2. package/dist/types/models/index.d.ts +1 -0
  3. package/dist/types/models/oracle/Risk.d.ts +1 -0
  4. package/dist/types/models/oracle/TableData.d.ts +1 -0
  5. package/dist/types/models/quotes/Club.d.ts +4 -0
  6. package/dist/types/models/quotes/Lead.d.ts +17 -0
  7. package/dist/types/models/quotes/PolicyEnhancement.d.ts +2 -0
  8. package/dist/types/models/quotes/PostalAddress.d.ts +7 -0
  9. package/dist/types/models/quotes/QuoteRequest.d.ts +121 -77
  10. package/dist/types/models/quotes/QuoteRequestDeclaration.d.ts +22 -0
  11. package/dist/types/models/quotes/QuoteRequestForm.d.ts +5 -0
  12. package/dist/types/models/quotes/QuoteRequestLog.d.ts +9 -0
  13. package/dist/types/models/quotes/QuoteRequestPurchaseOption.d.ts +20 -0
  14. package/dist/types/models/quotes/QuoteRequestReferrer.d.ts +7 -0
  15. package/dist/types/models/quotes/QuoteRequestReferrerCategory.d.ts +4 -0
  16. package/dist/types/models/quotes/QuoteRequestVehicle.d.ts +20 -0
  17. package/dist/types/models/quotes/QuoteRequestVehicleDriver.d.ts +10 -0
  18. package/dist/types/models/quotes/StreetAddress.d.ts +8 -0
  19. package/dist/types/models/quotes/index.d.ts +12 -0
  20. package/package.json +1 -1
  21. package/src/types/api/enums.ts +2 -0
  22. package/src/types/models/index.ts +1 -0
  23. package/src/types/models/oracle/Risk.ts +1 -0
  24. package/src/types/models/oracle/TableData.ts +1 -0
  25. package/src/types/models/quotes/Club.ts +4 -0
  26. package/src/types/models/quotes/Lead.ts +18 -0
  27. package/src/types/models/quotes/PolicyEnhancement.ts +3 -0
  28. package/src/types/models/quotes/PostalAddress.ts +7 -0
  29. package/src/types/models/quotes/QuoteRequest.ts +123 -78
  30. package/src/types/models/quotes/QuoteRequestDeclaration.ts +22 -0
  31. package/src/types/models/quotes/QuoteRequestForm.ts +5 -0
  32. package/src/types/models/quotes/QuoteRequestLog.ts +10 -0
  33. package/src/types/models/quotes/QuoteRequestPurchaseOption.ts +22 -0
  34. package/src/types/models/quotes/QuoteRequestReferrer.ts +8 -0
  35. package/src/types/models/quotes/QuoteRequestReferrerCategory.ts +4 -0
  36. package/src/types/models/quotes/QuoteRequestVehicle.ts +21 -0
  37. package/src/types/models/quotes/QuoteRequestVehicleDriver.ts +10 -0
  38. package/src/types/models/quotes/StreetAddress.ts +8 -0
  39. package/src/types/models/quotes/index.ts +12 -0
@@ -1,3 +1,4 @@
1
1
  export declare type VehicleType = 'car' | 'motorcycle' | 'motorhome';
2
2
  export declare type Frequency = 'daily' | 'weekly' | 'fortnightly' | 'monthly' | 'quarterly' | 'annually';
3
3
  export declare type Condition = 'poor' | 'fair' | 'good';
4
+ export declare type Product = 'star-enthusiast-prestige-everyday-plus' | 'star-enthusiast' | 'star-prestige' | 'star-everyday' | 'star-plus' | 'star-motorcycle' | 'star-campercare';
@@ -1,3 +1,4 @@
1
1
  export * from './auth';
2
2
  export * from './claims';
3
3
  export * from './oracle';
4
+ export * from './quotes';
@@ -3,5 +3,6 @@ export interface RiskDisplayValue {
3
3
  created_at: string;
4
4
  updated_at: string;
5
5
  RI_CODE: string;
6
+ RI_DESCRIPTION?: string;
6
7
  value: string;
7
8
  }
@@ -4,5 +4,6 @@ export interface TableDataDisplayValue {
4
4
  updated_at: string;
5
5
  tbl_type: string;
6
6
  tbl_code: string;
7
+ tbl_fullname?: string;
7
8
  value: string;
8
9
  }
@@ -0,0 +1,4 @@
1
+ export interface Club {
2
+ id: number;
3
+ name: string;
4
+ }
@@ -0,0 +1,17 @@
1
+ import { PostalAddress } from "./PostalAddress";
2
+ export interface Lead {
3
+ id: number;
4
+ first_name: string;
5
+ last_name: string;
6
+ email: string;
7
+ mobile: string;
8
+ status: string;
9
+ source: string;
10
+ postal_address_id: PostalAddress['id'];
11
+ current_insurer: string | null;
12
+ current_insurance_expires_at: string | null;
13
+ current_insurance_is_monthly: boolean;
14
+ vehicle_details: string | null;
15
+ notes: string | null;
16
+ import_data: string | null;
17
+ }
@@ -0,0 +1,2 @@
1
+ export interface PolicyEnhancement {
2
+ }
@@ -0,0 +1,7 @@
1
+ export interface PostalAddress {
2
+ id: number;
3
+ postal_line_1: string | null;
4
+ postal_line_2: string | null;
5
+ postal_line_3: string | null;
6
+ postal_line_4: string | null;
7
+ }
@@ -1,3 +1,15 @@
1
+ import { Product, VehicleType } from "../../api";
2
+ import { Club } from "./Club";
3
+ import { QuoteRequestIncident } from "./QuoteRequestForm";
4
+ import { Lead } from "./Lead";
5
+ import { PostalAddress } from "./PostalAddress";
6
+ import { QuoteRequestDeclaration } from "./QuoteRequestDeclaration";
7
+ import { QuoteRequestLog } from "./QuoteRequestLog";
8
+ import { PaymentFrequency, PremiumType, QuoteRequestPurchaseOption } from "./QuoteRequestPurchaseOption";
9
+ import { QuoteRequestReferrer } from "./QuoteRequestReferrer";
10
+ import { QuoteRequestReferrerCategory } from "./QuoteRequestReferrerCategory";
11
+ import { QuoteRequestVehicle } from "./QuoteRequestVehicle";
12
+ import { StreetAddress } from "./StreetAddress";
1
13
  export declare type QuoteRequestStatus = 'new' | 'draft' | 'in-progress' | 'with-customer' | 'sold' | 'bound' | 'customer-modified' | 'closed';
2
14
  export declare type QuoteRequestSource = 'web' | 'phone' | 'show' | 'existing-customer' | 'mighway' | 'agent' | 'entry-form' | 'bularangi';
3
15
  export declare type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE' | null;
@@ -12,32 +24,32 @@ export interface QuoteRequestUserGroup {
12
24
  }
13
25
  export interface QuoteRequest {
14
26
  id: string;
27
+ status: QuoteRequestStatus;
28
+ source: QuoteRequestSource;
15
29
  reference: string;
16
30
  client_number: string;
17
- first_name: string;
18
- last_name: string;
19
- phone: string;
20
- mobile: string;
21
- email: string;
22
- license: string;
31
+ first_name: string | null;
32
+ last_name: string | null;
33
+ phone: string | null;
34
+ mobile: string | null;
35
+ email: string | null;
36
+ license: string | null;
23
37
  license_other: string | null;
24
- has_automatch: boolean;
38
+ has_automatch: boolean | null;
25
39
  automatch_by: QuoteRequestAutomatch;
26
40
  automatch_client_id: string | null;
27
41
  promo_code: string | null;
28
- club_membership_number: string;
29
- broker_fee: number;
42
+ club_membership_number: string | null;
43
+ broker_fee: number | null;
30
44
  length_of_insurance: string | null;
31
45
  theme: string | null;
32
46
  created_at: string;
33
47
  updated_at: string;
34
- dob: string;
48
+ dob: string | null;
35
49
  sold_at: string | null;
36
50
  sent_at: string | null;
37
51
  pricing_expires_at: string | null;
38
52
  follow_up_at: string | null;
39
- status_id: QuoteRequestStatus;
40
- source_id: QuoteRequestSource;
41
53
  resubmit_id: QuoteRequest['id'] | null;
42
54
  referrer_id: QuoteRequestReferrer['id'] | null;
43
55
  referrer_category_id: QuoteRequestReferrerCategory['id'] | null;
@@ -48,8 +60,6 @@ export interface QuoteRequest {
48
60
  broker_id: QuoteRequestUser['id'] | null;
49
61
  club_id: Club['id'] | null;
50
62
  lead_id: Lead['id'] | null;
51
- status?: QuoteRequestStatus;
52
- source?: QuoteRequestSource;
53
63
  declaration?: QuoteRequestDeclaration;
54
64
  street_address?: StreetAddress;
55
65
  postal_address?: PostalAddress;
@@ -63,68 +73,102 @@ export interface QuoteRequest {
63
73
  broker_firm?: QuoteRequestUserGroup;
64
74
  club?: Club;
65
75
  lead?: Lead;
76
+ vehicles?: QuoteRequestVehicle[];
77
+ purchase_options?: QuoteRequestPurchaseOption[];
78
+ logs?: QuoteRequestLog[];
66
79
  }
67
- export interface QuoteRequestReferrer {
68
- id: number;
69
- name: string;
70
- category_id: QuoteRequestReferrerCategory['id'];
71
- category?: QuoteRequestReferrerCategory;
72
- }
73
- export interface QuoteRequestReferrerCategory {
74
- id: number;
75
- name: string;
76
- }
77
- export interface Club {
78
- id: number;
79
- name: string;
80
- }
81
- export interface StreetAddress {
82
- id: number;
83
- address: string | null;
84
- unit: string | null;
85
- suburb: string | null;
86
- city: string | null;
87
- post_code: string | null;
88
- }
89
- export interface PostalAddress {
90
- id: number;
91
- postal_line_1: string | null;
92
- postal_line_2: string | null;
93
- postal_line_3: string | null;
94
- postal_line_4: string | null;
95
- }
96
- export interface Lead {
97
- id: number;
98
- first_name: string;
99
- last_name: string;
100
- email: string;
101
- mobile: string;
102
- status: string;
103
- source: string;
104
- postal_address_id: PostalAddress['id'];
105
- current_insurer: string | null;
106
- current_insurance_expires_at: string | null;
107
- current_insurance_is_monthly: boolean;
108
- vehicle_details: string | null;
109
- notes: string | null;
110
- import_data: string | null;
111
- }
112
- export interface QuoteRequestDeclaration {
113
- id: number;
114
- quote_request_id: QuoteRequest['id'];
115
- had_incident: boolean;
116
- has_demerit_points: boolean;
117
- demerit_points: string | null;
118
- has_lost_license: boolean;
119
- lost_license_details: string | null;
120
- was_refused_insurance: boolean;
121
- refused_insurance_details: string | null;
122
- has_criminal_conviction: boolean;
123
- criminal_conviction_details: string | null;
124
- has_vehicle_modifications: boolean;
125
- vehicle_modifications_details: string | null;
126
- has_previous_insurer: boolean;
127
- previous_insurer_details: string | null;
128
- previous_insurer_expires_at: string | null;
129
- additional_details: string | null;
80
+ export interface QuoteRequestForm {
81
+ id?: string;
82
+ status?: QuoteRequestStatus;
83
+ source?: QuoteRequestSource;
84
+ reference?: string | null;
85
+ client_number?: string | null;
86
+ first_name?: string | null;
87
+ last_name?: string | null;
88
+ phone?: string | null;
89
+ mobile?: string | null;
90
+ email?: string | null;
91
+ license?: string | null;
92
+ license_other?: string | null;
93
+ promo_code?: string | null;
94
+ club_membership_number?: string | null;
95
+ broker_fee?: number | null;
96
+ length_of_insurance?: string | null;
97
+ theme?: string | null;
98
+ dob?: string | null;
99
+ sold_at?: string | null;
100
+ sent_at?: string | null;
101
+ pricing_expires_at?: string | null;
102
+ follow_up_at?: string | null;
103
+ status_id?: QuoteRequestStatus;
104
+ source_id?: QuoteRequestSource;
105
+ referrer_id?: QuoteRequestReferrer['id'] | null;
106
+ referrer_category_id?: QuoteRequestReferrerCategory['id'] | null;
107
+ staff_member_id?: QuoteRequestUser['id'] | null;
108
+ agent_id?: QuoteRequestUser['id'] | null;
109
+ agent_firm_id?: QuoteRequestUserGroup['id'] | null;
110
+ broker_firm_id?: QuoteRequestUserGroup['id'] | null;
111
+ broker_id?: QuoteRequestUser['id'] | null;
112
+ club_id?: Club['id'] | null;
113
+ declaration: {
114
+ id?: number;
115
+ had_incident?: boolean | null;
116
+ incidents?: QuoteRequestIncident[] | null;
117
+ has_demerit_points?: boolean | null;
118
+ demerit_points?: string | null;
119
+ has_lost_license?: boolean | null;
120
+ lost_license_details?: string | null;
121
+ was_refused_insurance?: boolean | null;
122
+ refused_insurance_details?: string | null;
123
+ has_criminal_conviction?: boolean | null;
124
+ criminal_conviction_details?: string | null;
125
+ has_vehicle_modifications?: boolean | null;
126
+ vehicle_modifications_details?: string | null;
127
+ has_previous_insurer?: boolean | null;
128
+ previous_insurer_details?: string | null;
129
+ previous_insurer_expires_at?: string | null;
130
+ additional_details?: string | null;
131
+ };
132
+ vehicles: {
133
+ id?: number;
134
+ vehicle_type?: VehicleType | null;
135
+ registration?: string | null;
136
+ make?: string | null;
137
+ model?: string | null;
138
+ year?: string | null;
139
+ usage?: string | null;
140
+ product?: Product | null;
141
+ has_financially_interested_party?: boolean | null;
142
+ financially_interested_party_detail?: string | null;
143
+ owned_duration?: string | null;
144
+ value?: number | null;
145
+ storage_location?: string | null;
146
+ is_heavy?: boolean | null;
147
+ drivers: {
148
+ id?: number;
149
+ first_name?: string;
150
+ last_name?: string;
151
+ dob?: string | null;
152
+ relationship?: string | null;
153
+ licence?: string | null;
154
+ licence_other?: string | null;
155
+ }[];
156
+ }[];
157
+ purchaseOptions?: {
158
+ id?: number;
159
+ level_of_insurance_id?: number | null;
160
+ sort_order?: number | null;
161
+ description?: string | null;
162
+ base_premium?: number | null;
163
+ premium?: number | null;
164
+ monthly_premium?: number | null;
165
+ show_monthly?: boolean | null;
166
+ fsl?: number | null;
167
+ gst?: number | null;
168
+ premium_type?: PremiumType | null;
169
+ policy_starts_at?: string | null;
170
+ sold_at?: string | null;
171
+ is_paid?: boolean | null;
172
+ payment_frequency?: PaymentFrequency | null;
173
+ };
130
174
  }
@@ -0,0 +1,22 @@
1
+ import { QuoteRequest } from "./QuoteRequest";
2
+ import { QuoteRequestIncident } from "./QuoteRequestForm";
3
+ export interface QuoteRequestDeclaration {
4
+ id: number;
5
+ quote_request_id: QuoteRequest['id'] | null;
6
+ had_incident: boolean | null;
7
+ incidents: QuoteRequestIncident[] | null;
8
+ has_demerit_points: boolean | null;
9
+ demerit_points: string | null;
10
+ has_lost_license: boolean | null;
11
+ lost_license_details: string | null;
12
+ was_refused_insurance: boolean | null;
13
+ refused_insurance_details: string | null;
14
+ has_criminal_conviction: boolean | null;
15
+ criminal_conviction_details: string | null;
16
+ has_vehicle_modifications: boolean | null;
17
+ vehicle_modifications_details: string | null;
18
+ has_previous_insurer: boolean | null;
19
+ previous_insurer_details: string | null;
20
+ previous_insurer_expires_at: string | null;
21
+ additional_details: string | null;
22
+ }
@@ -0,0 +1,5 @@
1
+ export interface QuoteRequestIncident {
2
+ year?: string | null;
3
+ month?: string | null;
4
+ description?: string | null;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { User } from "../auth";
2
+ export interface QuoteRequestLog {
3
+ id: number;
4
+ created_at: string;
5
+ quote_request_id: string;
6
+ user_id: number | null;
7
+ user?: User;
8
+ activity_type: string;
9
+ }
@@ -0,0 +1,20 @@
1
+ export interface QuoteRequestPurchaseOption {
2
+ id: number;
3
+ quote_request_id: string;
4
+ level_of_insurance_id: number | null;
5
+ sort_order: number | null;
6
+ description: string | null;
7
+ base_premium: number | null;
8
+ premium: number | null;
9
+ monthly_premium: number | null;
10
+ show_monthly: boolean | null;
11
+ fsl: number | null;
12
+ gst: number | null;
13
+ premium_type: PremiumType | null;
14
+ policy_starts_at: string | null | null;
15
+ sold_at: string | null | null;
16
+ is_paid: boolean | null;
17
+ payment_frequency: PaymentFrequency | null;
18
+ }
19
+ export declare type PremiumType = 'annual' | 'total-due';
20
+ export declare type PaymentFrequency = 'monthly' | 'annually';
@@ -0,0 +1,7 @@
1
+ import { QuoteRequestReferrerCategory } from "./QuoteRequestReferrerCategory";
2
+ export interface QuoteRequestReferrer {
3
+ id: number;
4
+ name: string;
5
+ category_id: QuoteRequestReferrerCategory['id'];
6
+ category?: QuoteRequestReferrerCategory;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface QuoteRequestReferrerCategory {
2
+ id: number;
3
+ name: string;
4
+ }
@@ -0,0 +1,20 @@
1
+ import { Product, VehicleType } from "../../api";
2
+ import { QuoteRequestVehicleDriver } from "./QuoteRequestVehicleDriver";
3
+ export interface QuoteRequestVehicle {
4
+ id: number;
5
+ vehicle_type: VehicleType | null;
6
+ registration: string | null;
7
+ make: string | null;
8
+ model: string | null;
9
+ year: string | null;
10
+ usage: string | null;
11
+ product: Product | null;
12
+ has_financially_interested_party: boolean | null;
13
+ financially_interested_party_detail: string | null;
14
+ owned_duration: string | null;
15
+ value: number | null;
16
+ storage_location: string | null;
17
+ is_heavy: boolean | null;
18
+ quote_request_id: string;
19
+ drivers?: QuoteRequestVehicleDriver[];
20
+ }
@@ -0,0 +1,10 @@
1
+ export interface QuoteRequestVehicleDriver {
2
+ id: number;
3
+ first_name: string | null;
4
+ last_name: string | null;
5
+ dob: string | null;
6
+ relationship: string | null;
7
+ licence: string | null;
8
+ licence_other: string | null;
9
+ quote_request_vehicle_id: number;
10
+ }
@@ -0,0 +1,8 @@
1
+ export interface StreetAddress {
2
+ id: number;
3
+ address: string | null;
4
+ unit: string | null;
5
+ suburb: string | null;
6
+ city: string | null;
7
+ post_code: string | null;
8
+ }
@@ -1 +1,13 @@
1
1
  export * from './QuoteRequest';
2
+ export * from './QuoteRequestDeclaration';
3
+ export * from './QuoteRequestVehicle';
4
+ export * from './QuoteRequestVehicleDriver';
5
+ export * from './QuoteRequestPurchaseOption';
6
+ export * from './PolicyEnhancement';
7
+ export * from './QuoteRequestReferrerCategory';
8
+ export * from './QuoteRequestReferrer';
9
+ export * from './Club';
10
+ export * from './Lead';
11
+ export * from './StreetAddress';
12
+ export * from './PostalAddress';
13
+ export * from './QuoteRequestForm';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "0.1.1",
5
+ "version": "0.1.4",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -3,3 +3,5 @@ export type VehicleType = 'car' | 'motorcycle' | 'motorhome';
3
3
  export type Frequency = 'daily' | 'weekly' | 'fortnightly' | 'monthly' | 'quarterly' | 'annually';
4
4
 
5
5
  export type Condition = 'poor' | 'fair' | 'good';
6
+
7
+ export type Product = 'star-enthusiast-prestige-everyday-plus' | 'star-enthusiast' | 'star-prestige' | 'star-everyday' | 'star-plus' | 'star-motorcycle' | 'star-campercare';
@@ -1,3 +1,4 @@
1
1
  export * from './auth';
2
2
  export * from './claims';
3
3
  export * from './oracle';
4
+ export * from './quotes';
@@ -3,5 +3,6 @@ export interface RiskDisplayValue {
3
3
  created_at: string;
4
4
  updated_at: string;
5
5
  RI_CODE: string;
6
+ RI_DESCRIPTION?: string;
6
7
  value: string;
7
8
  }
@@ -4,5 +4,6 @@ export interface TableDataDisplayValue {
4
4
  updated_at: string;
5
5
  tbl_type: string;
6
6
  tbl_code: string;
7
+ tbl_fullname?: string;
7
8
  value: string;
8
9
  }
@@ -0,0 +1,4 @@
1
+ export interface Club {
2
+ id: number;
3
+ name: string;
4
+ }
@@ -0,0 +1,18 @@
1
+ import { PostalAddress } from "./PostalAddress";
2
+
3
+ export interface Lead {
4
+ id: number;
5
+ first_name: string;
6
+ last_name: string;
7
+ email: string;
8
+ mobile: string;
9
+ status: string;
10
+ source: string;
11
+ postal_address_id: PostalAddress['id'];
12
+ current_insurer: string | null;
13
+ current_insurance_expires_at: string | null;
14
+ current_insurance_is_monthly: boolean;
15
+ vehicle_details: string | null;
16
+ notes: string | null;
17
+ import_data: string | null;
18
+ }
@@ -0,0 +1,3 @@
1
+ export interface PolicyEnhancement {
2
+
3
+ }
@@ -0,0 +1,7 @@
1
+ export interface PostalAddress {
2
+ id: number;
3
+ postal_line_1: string | null;
4
+ postal_line_2: string | null;
5
+ postal_line_3: string | null;
6
+ postal_line_4: string | null;
7
+ }
@@ -1,3 +1,16 @@
1
+ import { Product, VehicleType } from "../../api";
2
+ import { Club } from "./Club";
3
+ import { QuoteRequestIncident } from "./QuoteRequestForm";
4
+ import { Lead } from "./Lead";
5
+ import { PostalAddress } from "./PostalAddress";
6
+ import { QuoteRequestDeclaration } from "./QuoteRequestDeclaration";
7
+ import { QuoteRequestLog } from "./QuoteRequestLog";
8
+ import { PaymentFrequency, PremiumType, QuoteRequestPurchaseOption } from "./QuoteRequestPurchaseOption";
9
+ import { QuoteRequestReferrer } from "./QuoteRequestReferrer";
10
+ import { QuoteRequestReferrerCategory } from "./QuoteRequestReferrerCategory";
11
+ import { QuoteRequestVehicle } from "./QuoteRequestVehicle";
12
+ import { StreetAddress } from "./StreetAddress";
13
+
1
14
  export type QuoteRequestStatus = 'new' | 'draft' | 'in-progress' | 'with-customer' | 'sold' | 'bound' | 'customer-modified' | 'closed';
2
15
 
3
16
  export type QuoteRequestSource = 'web' | 'phone' | 'show' | 'existing-customer' | 'mighway' | 'agent' | 'entry-form' | 'bularangi';
@@ -17,36 +30,36 @@ export interface QuoteRequestUserGroup {
17
30
 
18
31
  export interface QuoteRequest {
19
32
  id: string;
33
+ status: QuoteRequestStatus;
34
+ source: QuoteRequestSource;
20
35
  reference: string;
21
36
  client_number: string;
22
- first_name: string;
23
- last_name: string;
24
- phone: string;
25
- mobile: string;
26
- email: string;
27
- license: string;
37
+ first_name: string | null;
38
+ last_name: string | null;
39
+ phone: string | null;
40
+ mobile: string | null;
41
+ email: string | null;
42
+ license: string | null;
28
43
  license_other: string | null;
29
- has_automatch: boolean;
44
+ has_automatch: boolean | null;
30
45
  automatch_by: QuoteRequestAutomatch;
31
46
  automatch_client_id: string | null;
32
47
  promo_code: string | null;
33
- club_membership_number: string;
34
- broker_fee: number;
48
+ club_membership_number: string | null;
49
+ broker_fee: number | null;
35
50
  length_of_insurance: string | null;
36
51
  theme: string | null;
37
52
 
38
53
  // Dates
39
54
  created_at: string;
40
55
  updated_at: string;
41
- dob: string;
56
+ dob: string | null;
42
57
  sold_at: string | null;
43
58
  sent_at: string | null;
44
59
  pricing_expires_at: string | null;
45
60
  follow_up_at: string | null;
46
61
 
47
62
  // Foreign keys
48
- status_id: QuoteRequestStatus;
49
- source_id: QuoteRequestSource;
50
63
  resubmit_id: QuoteRequest['id'] | null;
51
64
  referrer_id: QuoteRequestReferrer['id'] | null;
52
65
  referrer_category_id: QuoteRequestReferrerCategory['id'] | null;
@@ -59,8 +72,6 @@ export interface QuoteRequest {
59
72
  lead_id: Lead['id'] | null;
60
73
 
61
74
  // Relationships
62
- status?: QuoteRequestStatus;
63
- source?: QuoteRequestSource;
64
75
  declaration?: QuoteRequestDeclaration;
65
76
  street_address?: StreetAddress;
66
77
  postal_address?: PostalAddress;
@@ -74,75 +85,109 @@ export interface QuoteRequest {
74
85
  broker_firm?: QuoteRequestUserGroup;
75
86
  club?: Club;
76
87
  lead?: Lead;
88
+ vehicles?: QuoteRequestVehicle[];
89
+ purchase_options?: QuoteRequestPurchaseOption[];
90
+ logs?: QuoteRequestLog[];
77
91
  }
78
92
 
79
- export interface QuoteRequestReferrer {
80
- id: number;
81
- name: string;
82
- category_id: QuoteRequestReferrerCategory['id'];
83
- category?: QuoteRequestReferrerCategory;
84
- }
93
+ export interface QuoteRequestForm {
94
+ id?: string;
95
+ status?: QuoteRequestStatus;
96
+ source?: QuoteRequestSource;
97
+ reference?: string | null;
98
+ client_number?: string | null;
99
+ first_name?: string | null;
100
+ last_name?: string | null;
101
+ phone?: string | null;
102
+ mobile?: string | null;
103
+ email?: string | null;
104
+ license?: string | null;
105
+ license_other?: string | null;
106
+ promo_code?: string | null;
107
+ club_membership_number?: string | null;
108
+ broker_fee?: number | null;
109
+ length_of_insurance?: string | null;
110
+ theme?: string | null;
85
111
 
86
- export interface QuoteRequestReferrerCategory {
87
- id: number;
88
- name: string;
89
- }
112
+ dob?: string | null;
113
+ sold_at?: string | null;
114
+ sent_at?: string | null;
115
+ pricing_expires_at?: string | null;
116
+ follow_up_at?: string | null;
90
117
 
91
- export interface Club {
92
- id: number;
93
- name: string;
94
- }
95
-
96
- export interface StreetAddress {
97
- id: number;
98
- address: string | null;
99
- unit: string | null;
100
- suburb: string | null;
101
- city: string | null;
102
- post_code: string | null;
103
- }
118
+ // Foreign keys
119
+ status_id?: QuoteRequestStatus;
120
+ source_id?: QuoteRequestSource;
121
+ referrer_id?: QuoteRequestReferrer['id'] | null;
122
+ referrer_category_id?: QuoteRequestReferrerCategory['id'] | null;
123
+ staff_member_id?: QuoteRequestUser['id'] | null;
124
+ agent_id?: QuoteRequestUser['id'] | null;
125
+ agent_firm_id?: QuoteRequestUserGroup['id'] | null;
126
+ broker_firm_id?: QuoteRequestUserGroup['id'] | null;
127
+ broker_id?: QuoteRequestUser['id'] | null;
128
+ club_id?: Club['id'] | null;
104
129
 
105
- export interface PostalAddress {
106
- id: number;
107
- postal_line_1: string | null;
108
- postal_line_2: string | null;
109
- postal_line_3: string | null;
110
- postal_line_4: string | null;
111
- }
130
+ declaration: {
131
+ id?: number;
132
+ had_incident?: boolean | null;
133
+ incidents?: QuoteRequestIncident[] | null;
134
+ has_demerit_points?: boolean | null;
135
+ demerit_points?: string | null;
136
+ has_lost_license?: boolean | null;
137
+ lost_license_details?: string | null;
138
+ was_refused_insurance?: boolean | null;
139
+ refused_insurance_details?: string | null;
140
+ has_criminal_conviction?: boolean | null;
141
+ criminal_conviction_details?: string | null;
142
+ has_vehicle_modifications?: boolean | null;
143
+ vehicle_modifications_details?: string | null;
144
+ has_previous_insurer?: boolean | null;
145
+ previous_insurer_details?: string | null;
146
+ previous_insurer_expires_at?: string | null;
147
+ additional_details?: string | null;
148
+ }
112
149
 
113
- export interface Lead {
114
- id: number;
115
- first_name: string;
116
- last_name: string;
117
- email: string;
118
- mobile: string;
119
- status: string;
120
- source: string;
121
- postal_address_id: PostalAddress['id'];
122
- current_insurer: string | null;
123
- current_insurance_expires_at: string | null;
124
- current_insurance_is_monthly: boolean;
125
- vehicle_details: string | null;
126
- notes: string | null;
127
- import_data: string | null;
128
- }
150
+ vehicles: {
151
+ id?: number;
152
+ vehicle_type?: VehicleType | null;
153
+ registration?: string | null;
154
+ make?: string | null;
155
+ model?: string | null;
156
+ year?: string | null;
157
+ usage?: string | null;
158
+ product?: Product | null;
159
+ has_financially_interested_party?: boolean | null;
160
+ financially_interested_party_detail?: string | null;
161
+ owned_duration?: string | null;
162
+ value?: number | null;
163
+ storage_location?: string | null;
164
+ is_heavy?: boolean | null;
165
+ drivers: {
166
+ id?: number;
167
+ first_name?: string;
168
+ last_name?: string;
169
+ dob?: string | null;
170
+ relationship?: string | null;
171
+ licence?: string | null;
172
+ licence_other?: string | null;
173
+ }[];
174
+ }[],
129
175
 
130
- export interface QuoteRequestDeclaration {
131
- id: number;
132
- quote_request_id: QuoteRequest['id'];
133
- had_incident: boolean;
134
- has_demerit_points: boolean;
135
- demerit_points: string | null;
136
- has_lost_license: boolean;
137
- lost_license_details: string | null;
138
- was_refused_insurance: boolean;
139
- refused_insurance_details: string | null;
140
- has_criminal_conviction: boolean;
141
- criminal_conviction_details: string | null;
142
- has_vehicle_modifications: boolean;
143
- vehicle_modifications_details: string | null;
144
- has_previous_insurer: boolean;
145
- previous_insurer_details: string | null;
146
- previous_insurer_expires_at: string | null;
147
- additional_details: string | null;
176
+ purchaseOptions?: {
177
+ id?: number;
178
+ level_of_insurance_id?: number | null;
179
+ sort_order?: number | null;
180
+ description?: string | null;
181
+ base_premium?: number | null;
182
+ premium?: number | null;
183
+ monthly_premium?: number | null;
184
+ show_monthly?: boolean | null;
185
+ fsl?: number | null;
186
+ gst?: number | null;
187
+ premium_type?: PremiumType | null;
188
+ policy_starts_at?: string | null;
189
+ sold_at?: string | null;
190
+ is_paid?: boolean | null;
191
+ payment_frequency?: PaymentFrequency | null;
192
+ },
148
193
  }
@@ -0,0 +1,22 @@
1
+ import { QuoteRequest } from "./QuoteRequest";
2
+ import { QuoteRequestIncident } from "./QuoteRequestForm";
3
+ export interface QuoteRequestDeclaration {
4
+ id: number;
5
+ quote_request_id: QuoteRequest['id'] | null;
6
+ had_incident: boolean | null;
7
+ incidents: QuoteRequestIncident[] | null;
8
+ has_demerit_points: boolean | null;
9
+ demerit_points: string | null;
10
+ has_lost_license: boolean | null;
11
+ lost_license_details: string | null;
12
+ was_refused_insurance: boolean | null;
13
+ refused_insurance_details: string | null;
14
+ has_criminal_conviction: boolean | null;
15
+ criminal_conviction_details: string | null;
16
+ has_vehicle_modifications: boolean | null;
17
+ vehicle_modifications_details: string | null;
18
+ has_previous_insurer: boolean | null;
19
+ previous_insurer_details: string | null;
20
+ previous_insurer_expires_at: string | null;
21
+ additional_details: string | null;
22
+ }
@@ -0,0 +1,5 @@
1
+ export interface QuoteRequestIncident {
2
+ year?: string | null;
3
+ month?: string | null;
4
+ description?: string | null;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { User } from "../auth";
2
+
3
+ export interface QuoteRequestLog {
4
+ id: number;
5
+ created_at: string;
6
+ quote_request_id: string;
7
+ user_id: number | null;
8
+ user?: User;
9
+ activity_type: string;
10
+ }
@@ -0,0 +1,22 @@
1
+ export interface QuoteRequestPurchaseOption {
2
+ id: number;
3
+ quote_request_id: string;
4
+ level_of_insurance_id: number | null;
5
+ sort_order: number | null;
6
+ description: string | null;
7
+ base_premium: number | null;
8
+ premium: number | null;
9
+ monthly_premium: number | null;
10
+ show_monthly: boolean | null;
11
+ fsl: number | null;
12
+ gst: number | null;
13
+ premium_type: PremiumType | null;
14
+ policy_starts_at: string | null | null;
15
+ sold_at: string | null | null;
16
+ is_paid: boolean | null;
17
+ payment_frequency: PaymentFrequency | null;
18
+ }
19
+
20
+ export type PremiumType = 'annual' | 'total-due';
21
+
22
+ export type PaymentFrequency = 'monthly' | 'annually';
@@ -0,0 +1,8 @@
1
+ import { QuoteRequestReferrerCategory } from "./QuoteRequestReferrerCategory";
2
+
3
+ export interface QuoteRequestReferrer {
4
+ id: number;
5
+ name: string;
6
+ category_id: QuoteRequestReferrerCategory['id'];
7
+ category?: QuoteRequestReferrerCategory;
8
+ }
@@ -0,0 +1,4 @@
1
+ export interface QuoteRequestReferrerCategory {
2
+ id: number;
3
+ name: string;
4
+ }
@@ -0,0 +1,21 @@
1
+ import { Product, VehicleType } from "../../api";
2
+ import { QuoteRequestVehicleDriver } from "./QuoteRequestVehicleDriver";
3
+
4
+ export interface QuoteRequestVehicle {
5
+ id: number;
6
+ vehicle_type: VehicleType | null;
7
+ registration: string | null;
8
+ make: string | null;
9
+ model: string | null;
10
+ year: string | null;
11
+ usage: string | null;
12
+ product: Product | null;
13
+ has_financially_interested_party: boolean | null;
14
+ financially_interested_party_detail: string | null;
15
+ owned_duration: string | null;
16
+ value: number | null;
17
+ storage_location: string | null;
18
+ is_heavy: boolean | null;
19
+ quote_request_id: string;
20
+ drivers?: QuoteRequestVehicleDriver[];
21
+ }
@@ -0,0 +1,10 @@
1
+ export interface QuoteRequestVehicleDriver {
2
+ id: number;
3
+ first_name: string | null;
4
+ last_name: string | null;
5
+ dob: string | null;
6
+ relationship: string | null;
7
+ licence: string | null;
8
+ licence_other: string | null;
9
+ quote_request_vehicle_id: number;
10
+ }
@@ -0,0 +1,8 @@
1
+ export interface StreetAddress {
2
+ id: number;
3
+ address: string | null;
4
+ unit: string | null;
5
+ suburb: string | null;
6
+ city: string | null;
7
+ post_code: string | null;
8
+ }
@@ -1 +1,13 @@
1
1
  export * from './QuoteRequest';
2
+ export * from './QuoteRequestDeclaration';
3
+ export * from './QuoteRequestVehicle';
4
+ export * from './QuoteRequestVehicleDriver';
5
+ export * from './QuoteRequestPurchaseOption';
6
+ export * from './PolicyEnhancement';
7
+ export * from './QuoteRequestReferrerCategory';
8
+ export * from './QuoteRequestReferrer';
9
+ export * from './Club';
10
+ export * from './Lead';
11
+ export * from './StreetAddress';
12
+ export * from './PostalAddress';
13
+ export * from './QuoteRequestForm';