@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.
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/api/carInsuranceApi.interfaces.d.ts +235 -0
- package/dist/cjs/services/api/index.d.ts +1 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +3 -1
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/QuoteState/interfaces.d.ts +3 -1
- package/dist/cjs/states/reducers/states/formStates/FormLifeState/QuoteState/interfaces.d.ts +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/api/carInsuranceApi.interfaces.d.ts +235 -0
- package/dist/esm/services/api/index.d.ts +1 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +3 -1
- package/dist/esm/states/reducers/states/formStates/FormHomeState/QuoteState/interfaces.d.ts +3 -1
- package/dist/esm/states/reducers/states/formStates/FormLifeState/QuoteState/interfaces.d.ts +1 -0
- package/dist/index.d.ts +7 -2
- package/package.json +2 -2
|
@@ -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 {
|
package/dist/index.d.ts
CHANGED
|
@@ -1553,7 +1553,8 @@ declare enum StoreFormCarQuoteActionTypes {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
1555
|
declare enum CarBrokerTypeEnum {
|
|
1556
|
-
Youset = "youset"
|
|
1556
|
+
Youset = "youset",
|
|
1557
|
+
Mitch = "mitch"
|
|
1557
1558
|
}
|
|
1558
1559
|
interface BrokerProfileInterface$2 {
|
|
1559
1560
|
description: string;
|
|
@@ -1579,6 +1580,7 @@ interface CarQuoteCoverageInterface {
|
|
|
1579
1580
|
}
|
|
1580
1581
|
interface CarBrokerIntegrationInterface {
|
|
1581
1582
|
type: CarBrokerTypeEnum;
|
|
1583
|
+
ux?: 'contactonly';
|
|
1582
1584
|
data: Record<string, any>;
|
|
1583
1585
|
}
|
|
1584
1586
|
interface CarQuoteItemInterface {
|
|
@@ -2434,10 +2436,12 @@ declare enum StoreFormHomeQuoteActionTypes {
|
|
|
2434
2436
|
}
|
|
2435
2437
|
|
|
2436
2438
|
declare enum HomeBrokerTypeEnum {
|
|
2437
|
-
Youset = "youset"
|
|
2439
|
+
Youset = "youset",
|
|
2440
|
+
Mitch = "mitch"
|
|
2438
2441
|
}
|
|
2439
2442
|
interface HomeBrokerIntegrationInterface {
|
|
2440
2443
|
type: HomeBrokerTypeEnum;
|
|
2444
|
+
ux?: 'contactonly';
|
|
2441
2445
|
data: Record<string, any>;
|
|
2442
2446
|
}
|
|
2443
2447
|
interface BrokerProfileInterface$1 {
|
|
@@ -2771,6 +2775,7 @@ declare enum StoreFormLifeQuoteActionTypes {
|
|
|
2771
2775
|
|
|
2772
2776
|
interface LifeBrokerIntegrationInterface {
|
|
2773
2777
|
type: 'hub' | 'dcw';
|
|
2778
|
+
ux?: 'contactonly';
|
|
2774
2779
|
data: {
|
|
2775
2780
|
label?: string;
|
|
2776
2781
|
description?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mychoice/mychoice-sdk-store",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.17",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/hexdivision/mychoice-sdk#readme",
|
|
6
6
|
"author": "GogMes",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"redux": "^4.2.0",
|
|
38
38
|
"redux-thunk": "^2.4.1"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "d02cbadfc70909cd41a46532ef61bc85c6e9952f"
|
|
41
41
|
}
|