@mychoice/mychoice-sdk-store 2.2.14 → 2.2.17

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.
@@ -0,0 +1,235 @@
1
+ /**
2
+ * Car insurance API integration interfaces.
3
+ * Request/response contracts for all auto (car) insurance endpoints.
4
+ */
5
+ /** GET postal/auto/?postal_code={postalCode} */
6
+ export interface CarPostalGetParams {
7
+ postal_code: string;
8
+ }
9
+ export interface CarPostalResponse {
10
+ postalCode?: string;
11
+ city?: string;
12
+ locationIndex?: string;
13
+ provinceCode: string;
14
+ provinceName: string;
15
+ }
16
+ /** GET vehicle/year/{year} - response item */
17
+ export interface CarVehicleMakeItem {
18
+ make: string;
19
+ }
20
+ /** GET vehicle/year/{year}/make/{make} - response item */
21
+ export interface CarVehicleModelItem {
22
+ model: string;
23
+ }
24
+ export type CarVehicleMakeResponse = CarVehicleMakeItem[];
25
+ export type CarVehicleModelResponse = CarVehicleModelItem[];
26
+ export interface CarApiVehicleCoverage {
27
+ coverage: boolean;
28
+ deductible: number;
29
+ }
30
+ export interface CarApiVehicleLiabilityCoverage {
31
+ coverage: boolean;
32
+ limit: number;
33
+ }
34
+ export interface CarApiVehicleItem {
35
+ year: string | undefined;
36
+ make: string | undefined;
37
+ model: string | undefined;
38
+ leased: boolean;
39
+ purchaseDate: string;
40
+ winterTires: boolean;
41
+ parkingLocation: string;
42
+ primaryUse: string;
43
+ distanceDaily: number;
44
+ distanceBusiness?: number;
45
+ distanceYearly: number;
46
+ comprehensive: CarApiVehicleCoverage;
47
+ collision: CarApiVehicleCoverage;
48
+ liability: CarApiVehicleLiabilityCoverage;
49
+ lossofuse: CarApiVehicleLiabilityCoverage;
50
+ liabilityfordamage: CarApiVehicleLiabilityCoverage;
51
+ limitedwaiverofdepreciation: CarApiVehicleLiabilityCoverage;
52
+ postalCode?: string;
53
+ locationIndex?: string;
54
+ city?: string;
55
+ condition: string;
56
+ }
57
+ export interface CarApiDriverLicenceInfo {
58
+ licenceType: string;
59
+ firstLicenceAge: number;
60
+ g1LicenceDate?: string;
61
+ g2LicenceDate?: string;
62
+ gLicenceDate?: string;
63
+ passedDriverTraining?: boolean;
64
+ previousLicence?: boolean;
65
+ }
66
+ export interface CarApiDriverCancellationItem {
67
+ reason: string;
68
+ startDate: string;
69
+ endDate: string;
70
+ }
71
+ export interface CarApiDriverSuspensionItem {
72
+ reason: string;
73
+ suspensionDate: string;
74
+ reinstatementDate: string;
75
+ }
76
+ export interface CarApiDriverAccidentItem {
77
+ accidentDate: string;
78
+ }
79
+ export interface CarApiDriverTicketItem {
80
+ reason: string;
81
+ ticketDate: string;
82
+ }
83
+ export interface CarApiDriverItem {
84
+ firstName: string;
85
+ dateOfBirth: string;
86
+ maritalStatus: string;
87
+ gender: string;
88
+ occupation: string;
89
+ applicantRelationship?: string;
90
+ licenceInfo: CarApiDriverLicenceInfo;
91
+ listed: boolean;
92
+ listedYear?: string;
93
+ insured: boolean;
94
+ insuredYear?: string;
95
+ insuranceCancellation: boolean;
96
+ insuranceCancellationList?: CarApiDriverCancellationItem[];
97
+ licenceSuspension: boolean;
98
+ licenceSuspensionList?: CarApiDriverSuspensionItem[];
99
+ accident: boolean;
100
+ accidentList?: CarApiDriverAccidentItem[];
101
+ ticket: boolean;
102
+ ticketList?: CarApiDriverTicketItem[];
103
+ }
104
+ export interface CarApiQuoterInfo {
105
+ firstName: string;
106
+ lastName: string;
107
+ phone: string;
108
+ recalculate: boolean;
109
+ utmSource?: string;
110
+ utmCampaign?: string;
111
+ utmProducer?: string;
112
+ partner?: string;
113
+ initial: boolean;
114
+ hasToBeConfirmed?: boolean;
115
+ /** TheBig-specific */
116
+ brokerInfo?: Record<string, string | number | boolean>;
117
+ driverLicense?: string;
118
+ splashScreen?: boolean;
119
+ caslConsent?: boolean;
120
+ }
121
+ /** Driver–vehicle link: priority is 'Prn' | 'Occ' */
122
+ export interface CarApiVehLink {
123
+ driverIndex: number;
124
+ vehicleIndex: number;
125
+ priority: string;
126
+ }
127
+ export interface CarQuoteRequest {
128
+ vehicles: CarApiVehicleItem[];
129
+ drivers: CarApiDriverItem[];
130
+ vehlinks: CarApiVehLink[];
131
+ appInstallDiscount: boolean;
132
+ caaMemberDiscount: boolean;
133
+ multiplePoliciesDiscount: boolean;
134
+ policyStart: string;
135
+ quoterInfo: CarApiQuoterInfo;
136
+ emailTo: string;
137
+ provinceCode: string;
138
+ provinceName: string;
139
+ /** Present for TheBig app type */
140
+ postalCode?: string;
141
+ city?: string;
142
+ locationIndex?: string;
143
+ }
144
+ export interface CarQuoteCoverageItem {
145
+ annualPremium: number;
146
+ code: string;
147
+ deductible: string;
148
+ limit1: string;
149
+ limit2: string;
150
+ }
151
+ export interface CarQuoteBrokerProfile {
152
+ description: string;
153
+ hoursSaturday: string;
154
+ hoursSunday: string;
155
+ hoursWorkdays: string;
156
+ logo: string;
157
+ phone: string;
158
+ title: string;
159
+ redirectUrl?: string;
160
+ }
161
+ export interface CarQuoteCompany {
162
+ description: string;
163
+ logo: string;
164
+ name: string;
165
+ }
166
+ export interface CarQuoteNonStandardCoverages {
167
+ 20: boolean;
168
+ 27: boolean;
169
+ 43: boolean;
170
+ aCCW: boolean;
171
+ }
172
+ export interface CarBrokerIntegration {
173
+ type: string;
174
+ data: Record<string, unknown>;
175
+ }
176
+ export interface CarQuoteItemResponse {
177
+ brokerProfile: CarQuoteBrokerProfile;
178
+ company: CarQuoteCompany;
179
+ date: string;
180
+ id: number | null;
181
+ priceMonthly: string;
182
+ priceYearly: string;
183
+ confirmQuote?: boolean;
184
+ coverages: CarQuoteCoverageItem[];
185
+ nonStandardCoverages: CarQuoteNonStandardCoverages;
186
+ brokerIntegration?: CarBrokerIntegration;
187
+ }
188
+ export type CarQuoteResponse = CarQuoteItemResponse[];
189
+ /** Request body same as CarQuoteRequest. Response: */
190
+ export interface CarOnliaRedirectResponse {
191
+ redirectUrl: string;
192
+ }
193
+ export interface CarSendLeadRequest {
194
+ quote_id: number | null;
195
+ first_name: string;
196
+ last_name: string;
197
+ phone: string;
198
+ }
199
+ export interface CarInsuranceApiEndpoints {
200
+ /** GET - resolve postal code; params: CarPostalGetParams */
201
+ getPostal: {
202
+ params: CarPostalGetParams;
203
+ response: CarPostalResponse;
204
+ };
205
+ /** GET - list makes for year; path: vehicle/year/{year} */
206
+ getVehicleMakes: {
207
+ params: {
208
+ year: string;
209
+ };
210
+ response: CarVehicleMakeResponse;
211
+ };
212
+ /** GET - list models for year and make; path: vehicle/year/{year}/make/{make} */
213
+ getVehicleModels: {
214
+ params: {
215
+ year: string;
216
+ make: string;
217
+ };
218
+ response: CarVehicleModelResponse;
219
+ };
220
+ /** POST - submit quote; body: CarQuoteRequest */
221
+ postQuote: {
222
+ body: CarQuoteRequest;
223
+ response: CarQuoteResponse;
224
+ };
225
+ /** POST - get Onlia redirect URL; body: CarQuoteRequest */
226
+ postQuoteOnliaUrl: {
227
+ body: CarQuoteRequest;
228
+ response: CarOnliaRedirectResponse;
229
+ };
230
+ /** POST - send lead after quote; body: CarSendLeadRequest */
231
+ postSendLead: {
232
+ body: CarSendLeadRequest;
233
+ response: unknown;
234
+ };
235
+ }
@@ -0,0 +1 @@
1
+ export * from './carInsuranceApi.interfaces';
@@ -1,6 +1,7 @@
1
1
  import { StoreFormCarQuoteActionTypes } from './actions';
2
2
  export declare enum CarBrokerTypeEnum {
3
- Youset = "youset"
3
+ Youset = "youset",
4
+ Mitch = "mitch"
4
5
  }
5
6
  export interface BrokerProfileInterface {
6
7
  description: string;
@@ -26,6 +27,7 @@ export interface CarQuoteCoverageInterface {
26
27
  }
27
28
  export interface CarBrokerIntegrationInterface {
28
29
  type: CarBrokerTypeEnum;
30
+ ux?: 'contactonly';
29
31
  data: Record<string, any>;
30
32
  }
31
33
  export interface CarQuoteItemInterface {
@@ -1,9 +1,11 @@
1
1
  import { StoreFormHomeQuoteActionTypes } from './actions';
2
2
  export declare enum HomeBrokerTypeEnum {
3
- Youset = "youset"
3
+ Youset = "youset",
4
+ Mitch = "mitch"
4
5
  }
5
6
  export interface HomeBrokerIntegrationInterface {
6
7
  type: HomeBrokerTypeEnum;
8
+ ux?: 'contactonly';
7
9
  data: Record<string, any>;
8
10
  }
9
11
  export interface BrokerProfileInterface {
@@ -1,6 +1,7 @@
1
1
  import { StoreFormLifeQuoteActionTypes } from './actions';
2
2
  export interface LifeBrokerIntegrationInterface {
3
3
  type: 'hub' | 'dcw';
4
+ ux?: 'contactonly';
4
5
  data: {
5
6
  label?: string;
6
7
  description?: string;
package/dist/esm/index.js CHANGED
@@ -420,6 +420,7 @@ const globalStateReducer = combineReducers({
420
420
  var CarBrokerTypeEnum;
421
421
  (function (CarBrokerTypeEnum) {
422
422
  CarBrokerTypeEnum["Youset"] = "youset";
423
+ CarBrokerTypeEnum["Mitch"] = "mitch";
423
424
  })(CarBrokerTypeEnum || (CarBrokerTypeEnum = {}));
424
425
 
425
426
  const vehicleComprehensiveInitialState = {
@@ -2285,6 +2286,7 @@ const getDwellingInitialState = (type) => {
2285
2286
  var HomeBrokerTypeEnum;
2286
2287
  (function (HomeBrokerTypeEnum) {
2287
2288
  HomeBrokerTypeEnum["Youset"] = "youset";
2289
+ HomeBrokerTypeEnum["Mitch"] = "mitch";
2288
2290
  })(HomeBrokerTypeEnum || (HomeBrokerTypeEnum = {}));
2289
2291
 
2290
2292
  const formHomePostalInitialState = {