@star-insure/sdk 0.1.0

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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +8 -0
  5. package/dist/lib/dates.d.ts +8 -0
  6. package/dist/lib/index.d.ts +2 -0
  7. package/dist/lib/money.d.ts +32 -0
  8. package/dist/sdk.cjs.development.js +104 -0
  9. package/dist/sdk.cjs.development.js.map +1 -0
  10. package/dist/sdk.cjs.production.min.js +2 -0
  11. package/dist/sdk.cjs.production.min.js.map +1 -0
  12. package/dist/sdk.esm.js +92 -0
  13. package/dist/sdk.esm.js.map +1 -0
  14. package/dist/types/api/auth.d.ts +8 -0
  15. package/dist/types/api/enums.d.ts +3 -0
  16. package/dist/types/api/index.d.ts +30 -0
  17. package/dist/types/index.d.ts +3 -0
  18. package/dist/types/misc/index.d.ts +8 -0
  19. package/dist/types/misc/inertia.d.ts +8 -0
  20. package/dist/types/models/auth/Group.d.ts +10 -0
  21. package/dist/types/models/auth/Permission.d.ts +4 -0
  22. package/dist/types/models/auth/Role.d.ts +6 -0
  23. package/dist/types/models/auth/User.d.ts +12 -0
  24. package/dist/types/models/auth/index.d.ts +4 -0
  25. package/dist/types/models/claims/ClaimRequest.d.ts +267 -0
  26. package/dist/types/models/claims/index.d.ts +1 -0
  27. package/dist/types/models/index.d.ts +3 -0
  28. package/dist/types/models/oracle/Risk.d.ts +7 -0
  29. package/dist/types/models/oracle/TableData.d.ts +8 -0
  30. package/dist/types/models/oracle/index.d.ts +2 -0
  31. package/dist/types/models/quotes/QuoteRequest.d.ts +130 -0
  32. package/dist/types/models/quotes/index.d.ts +1 -0
  33. package/package.json +65 -0
  34. package/src/index.ts +2 -0
  35. package/src/lib/dates.ts +15 -0
  36. package/src/lib/index.ts +2 -0
  37. package/src/lib/money.ts +72 -0
  38. package/src/types/api/auth.ts +10 -0
  39. package/src/types/api/enums.ts +5 -0
  40. package/src/types/api/index.ts +34 -0
  41. package/src/types/index.ts +3 -0
  42. package/src/types/misc/index.ts +10 -0
  43. package/src/types/misc/inertia.ts +9 -0
  44. package/src/types/models/auth/Group.ts +11 -0
  45. package/src/types/models/auth/Permission.ts +4 -0
  46. package/src/types/models/auth/Role.ts +7 -0
  47. package/src/types/models/auth/User.ts +13 -0
  48. package/src/types/models/auth/index.ts +4 -0
  49. package/src/types/models/claims/ClaimRequest.ts +278 -0
  50. package/src/types/models/claims/index.ts +1 -0
  51. package/src/types/models/index.ts +3 -0
  52. package/src/types/models/oracle/Risk.ts +7 -0
  53. package/src/types/models/oracle/TableData.ts +8 -0
  54. package/src/types/models/oracle/index.ts +2 -0
  55. package/src/types/models/quotes/QuoteRequest.ts +148 -0
  56. package/src/types/models/quotes/index.ts +1 -0
@@ -0,0 +1,4 @@
1
+ export interface Permission {
2
+ id: number;
3
+ name: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { Permission } from ".";
2
+
3
+ export interface Role {
4
+ id: number;
5
+ name: string;
6
+ permissions?: Permission[];
7
+ }
@@ -0,0 +1,13 @@
1
+ import { Group } from ".";
2
+
3
+ export interface User {
4
+ id: number;
5
+ name: string;
6
+ email: string;
7
+ mobile?: string;
8
+ direct_dial?: string;
9
+ position?: string;
10
+ group_admin?: boolean;
11
+ umbrella_filter?: string;
12
+ groups?: Group[];
13
+ }
@@ -0,0 +1,4 @@
1
+ export * from './User';
2
+ export * from './Group';
3
+ export * from './Role';
4
+ export * from './Permission';
@@ -0,0 +1,278 @@
1
+ import { Condition, Frequency, VehicleType } from "../../api";
2
+
3
+ export type ClaimRequestStatus = 'new' | 'draft' | 'in-progress' | 'exported';
4
+
5
+ export interface ClaimRequest {
6
+ id: string;
7
+ reference: string;
8
+ 'status': ClaimRequestStatus;
9
+ 'submitted_at': string;
10
+ 'reminder_sent_at': string;
11
+ 'claim_number': string;
12
+ 'policyholder': string;
13
+ 'policy_number': string;
14
+ 'policy_cover_number': string;
15
+ 'policy_version_number': string;
16
+ 'policy_contact_name': string;
17
+ 'mobile': string;
18
+ 'email': string;
19
+ 'alternative_contact': string;
20
+ 'broker_firm': string;
21
+ 'broker_name': string;
22
+ 'address': string;
23
+ 'terms_accepted': boolean;
24
+ }
25
+
26
+ export interface DamageClaimRequest extends ClaimRequest {
27
+ 'vehicle_registration': string;
28
+ 'vehicle_vin': string;
29
+ 'vehicle_make': string;
30
+ 'vehicle_model': string;
31
+ 'vehicle_year': string|number;
32
+ 'vehicle_type': VehicleType;
33
+ 'finance_company': string;
34
+ 'finance_phone': string;
35
+ 'driver_name': string;
36
+ 'driver_dob': string;
37
+ 'driver_relationship': string;
38
+ 'driver_licence_number': string;
39
+ 'driver_licence_version': string;
40
+ 'driver_licence_issuer': string;
41
+ 'was_intoxicated': boolean;
42
+ 'intoxicated_details': string;
43
+ 'has_conviction': boolean;
44
+ 'conviction_details': string;
45
+ 'has_recent_claim': boolean;
46
+ 'incident_details': Incident[];
47
+ 'was_disqualified': boolean;
48
+ 'disqualified_details': string;
49
+ 'was_vehicle_used_without_consent': boolean;
50
+ 'vehicle_used_without_consent_details': string;
51
+ 'has_existing_vehicle_damage': boolean;
52
+ 'existing_vehicle_damage_details': string;
53
+ 'was_refused_insurance': boolean;
54
+ 'refused_insurance_details': string;
55
+ 'has_additional_information': boolean;
56
+ 'additional_information_details': string;
57
+ 'accident_location': string;
58
+ 'accident_suburb': string;
59
+ 'accident_happened_at': string;
60
+ 'accident_speed': string;
61
+ 'impact_speed': string;
62
+ 'road_surface': string;
63
+ 'weather_conditions': string;
64
+ 'had_passengers': boolean;
65
+ 'passenger_details': Passenger[];
66
+ 'has_witnesses': boolean;
67
+ 'witness_details': Witness[];
68
+ 'accident_description': string;
69
+ 'is_vehicle_drivable': boolean;
70
+ 'vehicle_drivable_details': string;
71
+ 'was_warning_given': boolean;
72
+ 'warning_given_details': string;
73
+ 'was_third_party_responsible': boolean;
74
+ 'third_party_responsible_details': string;
75
+ 'was_third_party_involved': boolean;
76
+ 'third_party_vehicle_registration': string;
77
+ 'third_party_vehicle_owner': string;
78
+ 'third_party_vehicle_make': string;
79
+ 'third_party_vehicle_model': string;
80
+ 'third_party_vehicle_driver_name': string;
81
+ 'third_party_vehicle_driver_mobile': string;
82
+ 'third_party_vehicle_driver_phone': string;
83
+ 'third_party_vehicle_driver_address': string;
84
+ 'third_party_vehicle_insurance_company': string;
85
+ 'third_party_vehicle_damage': string;
86
+ 'third_party_details_provided': string;
87
+ 'were_police_notified': boolean;
88
+ 'did_police_attend': boolean;
89
+ 'police_officer_name': string;
90
+ 'police_officer_email': string;
91
+ 'police_reference': string;
92
+ 'police_station_address': string;
93
+ 'police_did_test': boolean;
94
+ 'police_issued_notice': boolean;
95
+ 'repairer_name': string;
96
+ 'repairer_phone': string;
97
+ 'repairer_email': string;
98
+ 'is_claiming_protective_gear': boolean;
99
+ 'is_protective_gear_insured_elsewhere': boolean;
100
+ 'protective_gear_details': ClaimItem[];
101
+ 'is_claiming_contents': boolean;
102
+ 'is_contents_insured_elsewhere': boolean;
103
+ 'contents_details': ClaimItem[];
104
+ }
105
+
106
+ export interface Incident {
107
+ 'year': string;
108
+ 'month': string;
109
+ 'description': string;
110
+ }
111
+
112
+ export interface Passenger {
113
+ 'name': string;
114
+ 'phone'?: string;
115
+ 'email'?: string;
116
+ 'address'?: string;
117
+ }
118
+
119
+ export interface Witness {
120
+ 'name': string;
121
+ 'phone'?: string;
122
+ 'email'?: string;
123
+ 'address'?: string;
124
+ }
125
+
126
+ export interface ClaimItem {
127
+ 'description': string;
128
+ 'purchased_from'?: string;
129
+ 'age'?: string;
130
+ 'purchase_price'?: string;
131
+ 'replacement_cost'?: string;
132
+ }
133
+
134
+ export interface GlassClaimRequest extends ClaimRequest {
135
+ 'vehicle_registration': string;
136
+ 'vehicle_vin': string;
137
+ 'vehicle_make': string;
138
+ 'vehicle_model': string;
139
+ 'vehicle_year': string|number;
140
+ 'accident_location': string;
141
+ 'accident_happened_at': string;
142
+ 'accident_description': string;
143
+ 'repairer_name': string;
144
+ 'repairer_phone': string;
145
+ 'repairer_email': string;
146
+ }
147
+
148
+ export interface TheftClaimRequest extends ClaimRequest {
149
+ 'vehicle_registration': string;
150
+ 'vehicle_vin': string;
151
+ 'vehicle_make': string;
152
+ 'vehicle_model': string;
153
+ 'vehicle_year': string|number;
154
+ 'vehicle_type': VehicleType;
155
+ 'finance_company': string;
156
+ 'finance_phone': string;
157
+ 'is_leased': boolean;
158
+ 'lease_name': string;
159
+ 'lease_address': string;
160
+ 'lease_phone': string;
161
+ 'lease_number': string;
162
+ 'lease_payment_amount': string|number;
163
+ 'lease_payment_frequency': Frequency;
164
+ 'has_conviction': boolean;
165
+ 'conviction_details': string;
166
+ 'has_recent_claim': boolean;
167
+ 'incident_details': Incident[];
168
+ 'was_disqualified': boolean;
169
+ 'disqualified_details': string;
170
+ 'was_vehicle_used_without_consent': boolean;
171
+ 'vehicle_used_without_consent_details': string;
172
+ 'has_existing_vehicle_damage': boolean;
173
+ 'existing_vehicle_damage_details': string;
174
+ 'was_refused_insurance': boolean;
175
+ 'refused_insurance_details': string;
176
+ 'has_additional_information': boolean;
177
+ 'additional_information_details': string;
178
+ 'vehicle_purchased_on': string;
179
+ 'vehicle_purchased_from': string;
180
+ 'vehicle_purchased_price': string|number;
181
+ 'vehicle_value': number;
182
+ 'was_vehicle_for_sale': boolean;
183
+ 'vehicle_first_asking_price': string|number;
184
+ 'vehicle_last_asking_price': string|number;
185
+ 'vehicle_sale_duration': string;
186
+ 'vehicle_purchaser_name': string;
187
+ 'vehicle_purchaser_address': string;
188
+ 'vehicle_purchaser_phone': string;
189
+ 'vehicle_hp_cc_rating': string;
190
+ 'vehicle_transmission': string;
191
+ 'vehicle_engine_number': string;
192
+ 'vehicle_has_air_conditioning': boolean;
193
+ 'vehicle_has_cng': boolean;
194
+ 'vehicle_has_lpg': boolean;
195
+ 'vehicle_colour': string;
196
+ 'vehicle_colour_changes': string;
197
+ 'was_vehicle_repaired': boolean;
198
+ 'vehicle_repaired_damage_details': string;
199
+ 'vehicle_repairer': string;
200
+ 'vehicle_repaired_on': string;
201
+ 'was_vehicle_damaged': boolean;
202
+ 'vehicle_damage_details': string;
203
+ 'vehicle_tyre_condition_front_right': Condition;
204
+ 'vehicle_tyre_condition_front_left': Condition;
205
+ 'vehicle_tyre_condition_rear_right': Condition;
206
+ 'vehicle_tyre_condition_rear_left': Condition;
207
+ 'vehicle_tyre_condition_spare': string;
208
+ 'wheel_assembly_details': string;
209
+ 'is_vehicle_radio_original': boolean;
210
+ 'vehicle_radio_make': string;
211
+ 'vehicle_radio_location': string;
212
+ 'vehicle_radio_fixing': string;
213
+ 'vehicle_speaker_make': string;
214
+ 'accessory_details': Accessory[];
215
+ 'identifiable_contents_details': Contents[];
216
+ 'vehicle_serviced_by': string;
217
+ 'has_service_invoices': boolean;
218
+ 'vehicle_wof_issued_by': string;
219
+ 'vehicle_wof_issued_on': string;
220
+ 'vehicle_wof_expires_on': string;
221
+ 'vehicle_floor_type': string;
222
+ 'vehicle_interior_details': string;
223
+ 'vehicle_seatbelt_type': string;
224
+ 'vehicle_seatbelt_condition': Condition;
225
+ 'vehicle_engine_condition': Condition;
226
+ 'vehicle_gearbox_condition': Condition;
227
+ 'vehicle_transmission_condition': Condition;
228
+ 'vehicle_suspension_condition': Condition;
229
+ 'vehicle_steering_condition': Condition;
230
+ 'vehicle_seats_condition': Condition;
231
+ 'vehicle_trims_condition': Condition;
232
+ 'vehicle_body_condition': Condition;
233
+ 'vehicle_paint_condition': Condition;
234
+ 'vehicle_dashboard_condition': Condition;
235
+ 'vehicle_engine_oil_per_month': string;
236
+ 'vehicle_ran_well': boolean;
237
+ 'theft_details': string;
238
+ 'theft_happened_on': string;
239
+ 'theft_discovered_on': string;
240
+ 'vehicle_last_used_by': string;
241
+ 'were_windows_up': boolean;
242
+ 'windows_down_details': string;
243
+ 'were_doors_locked': boolean;
244
+ 'doors_unlocked_details': string;
245
+ 'has_theft_evidence': boolean;
246
+ 'theft_evidence_details': string;
247
+ 'has_steering_lock': boolean;
248
+ 'has_alarm': boolean;
249
+ 'was_alarm_active': boolean;
250
+ 'alarm_inactive_details': string;
251
+ 'was_boot_locked': boolean;
252
+ 'boot_unlocked_details': string;
253
+ 'keys_count': string;
254
+ 'key_holder_name': string;
255
+ 'key_holder_phone': string;
256
+ 'key_holder_address': string;
257
+ 'keys_location': string;
258
+ 'policyholder_whereabouts_details': string;
259
+ 'were_police_notified': boolean;
260
+ 'did_police_attend': boolean;
261
+ 'police_officer_name': string;
262
+ 'police_officer_email': string;
263
+ 'police_reference': string;
264
+ 'police_station_address': string;
265
+ 'is_claiming_contents': boolean;
266
+ 'is_contents_insured_elsewhere': boolean;
267
+ 'contents_details': ClaimItem[];
268
+ }
269
+
270
+ export interface Accessory {
271
+ 'description': string;
272
+ 'age': string;
273
+ 'condition': string;
274
+ }
275
+
276
+ export interface Contents {
277
+ 'description': string;
278
+ }
@@ -0,0 +1 @@
1
+ export * from './ClaimRequest';
@@ -0,0 +1,3 @@
1
+ export * from './auth';
2
+ export * from './claims';
3
+ export * from './oracle';
@@ -0,0 +1,7 @@
1
+ export interface RiskDisplayValue {
2
+ id: number;
3
+ created_at: string;
4
+ updated_at: string;
5
+ RI_CODE: string;
6
+ value: string;
7
+ }
@@ -0,0 +1,8 @@
1
+ export interface TableDataDisplayValue {
2
+ id: number;
3
+ created_at: string;
4
+ updated_at: string;
5
+ tbl_type: string;
6
+ tbl_code: string;
7
+ value: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './Risk';
2
+ export * from './TableData';
@@ -0,0 +1,148 @@
1
+ export type QuoteRequestStatus = 'new' | 'draft' | 'in-progress' | 'with-customer' | 'sold' | 'bound' | 'customer-modified' | 'closed';
2
+
3
+ export type QuoteRequestSource = 'web' | 'phone' | 'show' | 'existing-customer' | 'mighway' | 'agent' | 'entry-form' | 'bularangi';
4
+
5
+ export type QuoteRequestAutomatch = 'QUOTE' | 'EMAIL' | 'REGISTRATION' | 'DUPLICATE' | null;
6
+
7
+ export interface QuoteRequestUser {
8
+ id: number;
9
+ name: string;
10
+ email: string;
11
+ }
12
+
13
+ export interface QuoteRequestUserGroup {
14
+ id: number;
15
+ name: string;
16
+ }
17
+
18
+ export interface QuoteRequest {
19
+ id: string;
20
+ reference: string;
21
+ client_number: string;
22
+ first_name: string;
23
+ last_name: string;
24
+ phone: string;
25
+ mobile: string;
26
+ email: string;
27
+ license: string;
28
+ license_other: string | null;
29
+ has_automatch: boolean;
30
+ automatch_by: QuoteRequestAutomatch;
31
+ automatch_client_id: string | null;
32
+ promo_code: string | null;
33
+ club_membership_number: string;
34
+ broker_fee: number;
35
+ length_of_insurance: string | null;
36
+ theme: string | null;
37
+
38
+ // Dates
39
+ created_at: string;
40
+ updated_at: string;
41
+ dob: string;
42
+ sold_at: string | null;
43
+ sent_at: string | null;
44
+ pricing_expires_at: string | null;
45
+ follow_up_at: string | null;
46
+
47
+ // Foreign keys
48
+ status_id: QuoteRequestStatus;
49
+ source_id: QuoteRequestSource;
50
+ resubmit_id: QuoteRequest['id'] | null;
51
+ referrer_id: QuoteRequestReferrer['id'] | null;
52
+ referrer_category_id: QuoteRequestReferrerCategory['id'] | null;
53
+ staff_member_id: QuoteRequestUser['id'] | null;
54
+ agent_id: QuoteRequestUser['id'] | null;
55
+ agent_firm_id: QuoteRequestUserGroup['id'] | null;
56
+ broker_firm_id: QuoteRequestUserGroup['id'] | null;
57
+ broker_id: QuoteRequestUser['id'] | null;
58
+ club_id: Club['id'] | null;
59
+ lead_id: Lead['id'] | null;
60
+
61
+ // Relationships
62
+ status?: QuoteRequestStatus;
63
+ source?: QuoteRequestSource;
64
+ declaration?: QuoteRequestDeclaration;
65
+ street_address?: StreetAddress;
66
+ postal_address?: PostalAddress;
67
+ resubmit?: QuoteRequest;
68
+ referrer?: QuoteRequestReferrer;
69
+ referrer_category?: QuoteRequestReferrerCategory;
70
+ staff_member?: QuoteRequestUser;
71
+ agent?: QuoteRequestUser;
72
+ agent_firm?: QuoteRequestUserGroup;
73
+ broker?: QuoteRequestUser;
74
+ broker_firm?: QuoteRequestUserGroup;
75
+ club?: Club;
76
+ lead?: Lead;
77
+ }
78
+
79
+ export interface QuoteRequestReferrer {
80
+ id: number;
81
+ name: string;
82
+ category_id: QuoteRequestReferrerCategory['id'];
83
+ category?: QuoteRequestReferrerCategory;
84
+ }
85
+
86
+ export interface QuoteRequestReferrerCategory {
87
+ id: number;
88
+ name: string;
89
+ }
90
+
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
+ }
104
+
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
+ }
112
+
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
+ }
129
+
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;
148
+ }
@@ -0,0 +1 @@
1
+ export * from './QuoteRequest';