@mychoice/mychoice-sdk-store 2.2.9 → 2.2.11

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,4 @@
1
+ export * from './types';
2
+ export * from './utils';
3
+ export * from './useAutofillCarForm';
4
+ export * from './useAutofillLifeForm';
@@ -0,0 +1,102 @@
1
+ export interface AutofillDriver {
2
+ gender: string;
3
+ listed: boolean;
4
+ ticket: boolean;
5
+ insured: boolean;
6
+ accident: boolean;
7
+ first_name: string;
8
+ occupation: number;
9
+ listed_year?: string;
10
+ insured_year?: string;
11
+ licence_info: {
12
+ licence_type: string;
13
+ g_licence_date?: string;
14
+ g1_licence_date?: string;
15
+ g2_licence_date?: string;
16
+ first_licence_age: number;
17
+ };
18
+ date_of_birth: string;
19
+ marital_status: string;
20
+ licence_suspension: boolean;
21
+ insurance_cancellation: boolean;
22
+ }
23
+ export interface AutofillVehicleCoverage {
24
+ coverage: boolean;
25
+ deductible?: number;
26
+ limit?: number;
27
+ }
28
+ export interface AutofillVehicle {
29
+ city: string;
30
+ make: string;
31
+ year: number;
32
+ model: string;
33
+ leased: boolean;
34
+ condition: string;
35
+ liability: AutofillVehicleCoverage;
36
+ collision: AutofillVehicleCoverage;
37
+ lossofuse: AutofillVehicleCoverage;
38
+ comprehensive: AutofillVehicleCoverage;
39
+ liabilityfordamage: AutofillVehicleCoverage;
40
+ limitedwaiverofdepreciation: AutofillVehicleCoverage;
41
+ postal_code: string;
42
+ primary_use: string;
43
+ winter_tires: boolean;
44
+ purchase_date: string;
45
+ distance_daily: number;
46
+ distance_yearly: number;
47
+ parking_location: string;
48
+ distance_business: number;
49
+ location_index: number;
50
+ bodytype: string;
51
+ ext_vicc: string;
52
+ vicc_code: string;
53
+ }
54
+ export interface AutofillVehLink {
55
+ priority: string;
56
+ driver_index: number;
57
+ vehicle_index: number;
58
+ }
59
+ export interface AutofillData {
60
+ uuid: string;
61
+ drivers: AutofillDriver[];
62
+ vehicles: AutofillVehicle[];
63
+ vehlinks: AutofillVehLink[];
64
+ email_to: string;
65
+ policy_start: string;
66
+ province_code: string;
67
+ caa_member_discount: boolean;
68
+ app_install_discount: boolean;
69
+ multiple_policies_discount: boolean;
70
+ }
71
+ export interface MappedAutofillData {
72
+ drivers: any[];
73
+ vehicles: any[];
74
+ postalData: any;
75
+ configData: any;
76
+ }
77
+ export interface LifeAutofillQuoterInfo {
78
+ phone: number;
79
+ last_name: string;
80
+ first_name: string;
81
+ utm_source: string | null;
82
+ recalculate: boolean;
83
+ utm_campaign: string | null;
84
+ }
85
+ export interface LifeAutofillData {
86
+ Sex: string;
87
+ uuid: string;
88
+ City: string;
89
+ State: string;
90
+ Health: string;
91
+ Smoker: string;
92
+ Birthday: string;
93
+ ModeUsed: string;
94
+ email_to: string;
95
+ BirthYear: string;
96
+ BirthMonth: string;
97
+ FaceAmount: number;
98
+ IsUsaQuote: boolean;
99
+ PostalCode: string;
100
+ NewCategory: string;
101
+ quoter_info: LifeAutofillQuoterInfo;
102
+ }
@@ -0,0 +1,8 @@
1
+ interface AutofillOptions {
2
+ onComplete?: () => void;
3
+ }
4
+ /**
5
+ * Hook to initialize car insurance form with autofill data from query parameter
6
+ */
7
+ export declare const useAutofillCarForm: (options?: AutofillOptions) => void;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ interface AutofillOptions {
2
+ onComplete?: () => void;
3
+ }
4
+ /**
5
+ * Hook to initialize life insurance form with autofill data from query parameter
6
+ */
7
+ export declare const useAutofillLifeForm: (options?: AutofillOptions) => void;
8
+ export {};
@@ -0,0 +1,142 @@
1
+ import { AutofillData } from './types';
2
+ /**
3
+ * Parse URL-encoded JSON from query parameter
4
+ */
5
+ export declare const parseAutofillParam: (urlEncodedJson: string) => AutofillData;
6
+ /**
7
+ * Get province name from code
8
+ */
9
+ export declare const getProvinceName: (code: string) => string;
10
+ /**
11
+ * Map autofill data to postal state format
12
+ */
13
+ export declare const mapToPostalState: (autofillData: AutofillData) => {
14
+ city: string;
15
+ postalCode: string;
16
+ locationIndex: string;
17
+ provinceCode: string;
18
+ provinceName: string;
19
+ };
20
+ /**
21
+ * Map autofill data to vehicle state format
22
+ */
23
+ export declare const mapToVehicleState: (autofillData: AutofillData) => {
24
+ year: string;
25
+ make: string;
26
+ model: string;
27
+ condition: string;
28
+ leased: boolean;
29
+ purchaseDate: string;
30
+ winterTires: boolean;
31
+ parkingLocation: string;
32
+ primaryUse: string;
33
+ distanceDaily: number;
34
+ distanceBusiness: number;
35
+ distanceYearly: number;
36
+ comprehensive: {
37
+ coverage: boolean;
38
+ deductible: number;
39
+ };
40
+ collision: {
41
+ coverage: boolean;
42
+ deductible: number;
43
+ };
44
+ liability: {
45
+ coverage: boolean;
46
+ limit: number;
47
+ };
48
+ lossofuse: {
49
+ coverage: boolean;
50
+ limit: number;
51
+ };
52
+ liabilityfordamage: {
53
+ coverage: boolean;
54
+ limit: number;
55
+ };
56
+ limitedwaiverofdepreciation: {
57
+ coverage: boolean;
58
+ limit: number;
59
+ };
60
+ postalCode: string;
61
+ locationIndex: string;
62
+ city: string;
63
+ };
64
+ /**
65
+ * Map autofill data to driver state format
66
+ */
67
+ export declare const mapToDriverState: (autofillData: AutofillData) => {
68
+ firstName: string;
69
+ dateOfBirth: string;
70
+ maritalStatus: string;
71
+ gender: string;
72
+ occupation: number;
73
+ listed: boolean;
74
+ listedYear: string;
75
+ insured: boolean;
76
+ insuredYear: string;
77
+ ticket: boolean;
78
+ accident: boolean;
79
+ licenceSuspension: boolean;
80
+ insuranceCancellation: boolean;
81
+ licenceInfo: {
82
+ licenceType: string;
83
+ firstLicenceAge: number;
84
+ gLicenceDate: string;
85
+ g1LicenceDate: string;
86
+ g2LicenceDate: string;
87
+ };
88
+ };
89
+ /**
90
+ * Map autofill data to config state format
91
+ */
92
+ export declare const mapToConfigState: (autofillData: AutofillData) => {
93
+ province: string;
94
+ };
95
+ /**
96
+ * Parse URL-encoded JSON from query parameter for life insurance
97
+ */
98
+ export declare const parseLifeAutofillParam: (urlEncodedJson: string) => any;
99
+ /**
100
+ * Get province code from state number
101
+ */
102
+ export declare const getProvinceCodeFromState: (stateNumber: string) => string;
103
+ /**
104
+ * Map life autofill data to coverage state format
105
+ */
106
+ export declare const mapToLifeCoverageState: (autofillData: any) => {
107
+ province: string;
108
+ type: any;
109
+ coverage: string;
110
+ postalCode: any;
111
+ city: any;
112
+ };
113
+ /**
114
+ * Map life autofill data to applicant state format
115
+ */
116
+ export declare const mapToLifeApplicantState: (autofillData: any) => {
117
+ birthYear: any;
118
+ birthMonth: any;
119
+ birthDay: any;
120
+ gender: any;
121
+ smoker: boolean;
122
+ emailTo: {
123
+ email: any;
124
+ };
125
+ quoterInfo: {
126
+ firstName: any;
127
+ lastName: any;
128
+ phone: string;
129
+ utmSource: any;
130
+ utmCampaign: any;
131
+ };
132
+ };
133
+ /**
134
+ * Map life autofill data to postal state format
135
+ */
136
+ export declare const mapToLifePostalState: (autofillData: any) => {
137
+ postalCode: any;
138
+ provinceCode: string;
139
+ provinceName: string;
140
+ city: any;
141
+ locationIndex: string;
142
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './dataHandlers';
2
2
  export * from './validationHandlers';
3
3
  export * from './helper';
4
+ export * from './autofill';