@mychoice/mychoice-sdk-store 2.2.11 → 2.2.14
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 +100 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/ConfigState/hoox.d.ts +3 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/actions.d.ts +5 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +2 -2
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/initialState.d.ts +5 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +28 -0
- package/dist/esm/index.js +100 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/ConfigState/hoox.d.ts +3 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/actions.d.ts +5 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +2 -2
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/initialState.d.ts +5 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +28 -0
- package/dist/index.d.ts +38 -2
- package/package.json +3 -3
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { FormCarConfigHookInterface, ProvinceHookInterface } from './interfaces';
|
|
2
2
|
export declare const useStoreFormCarConfig: () => FormCarConfigHookInterface;
|
|
3
3
|
export declare const useProvince: () => ProvinceHookInterface;
|
|
4
|
+
export declare const useAbReform: () => {
|
|
5
|
+
isAbReformActive: boolean;
|
|
6
|
+
};
|
|
@@ -30,5 +30,9 @@ export declare enum StoreFormCarVehicleActionTypes {
|
|
|
30
30
|
FormCarVehicleValidateSet = "FormCarVehicleValidateSet",
|
|
31
31
|
FormCarLossOfUseCoverageSelect = "FormCarLossOfUseCoverageSelect",
|
|
32
32
|
FormCarLiabilityForDamageCoverageSelect = "FormCarLiabilityForDamageCoverageSelect",
|
|
33
|
-
FormCarLimitedWaiverOfDepreciationCoverageSelect = "FormCarLimitedWaiverOfDepreciationCoverageSelect"
|
|
33
|
+
FormCarLimitedWaiverOfDepreciationCoverageSelect = "FormCarLimitedWaiverOfDepreciationCoverageSelect",
|
|
34
|
+
FormCarAccidentBenefitsBaseCoverageSelect = "FormCarAccidentBenefitsBaseCoverageSelect",
|
|
35
|
+
FormCarAccidentBenefitsAdditionalCoveragesSet = "FormCarAccidentBenefitsAdditionalCoveragesSet",
|
|
36
|
+
FormCarAccidentBenefitsAdditionalCoverageRemove = "FormCarAccidentBenefitsAdditionalCoverageRemove",
|
|
37
|
+
FormCarAccidentBenefitsAcknowledge = "FormCarAccidentBenefitsAcknowledge"
|
|
34
38
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { VehicleConditionTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
|
-
import { FormCarVehicleStateInterface } from './interfaces';
|
|
2
|
+
import { VehicleAccidentBenefitsInterface, FormCarVehicleStateInterface } from './interfaces';
|
|
3
3
|
export declare const removeVehicleItem: (state: FormCarVehicleStateInterface, vehicleIndex: number) => FormCarVehicleStateInterface;
|
|
4
4
|
export declare const createVehicleItem: (state: FormCarVehicleStateInterface) => FormCarVehicleStateInterface;
|
|
5
5
|
export declare const setVehicleProperty: (state: FormCarVehicleStateInterface, name: string, value: boolean) => FormCarVehicleStateInterface;
|
|
6
6
|
export declare const setVehicleYear: (state: FormCarVehicleStateInterface, vehicleYear: string) => FormCarVehicleStateInterface;
|
|
7
7
|
export declare const setVehicleMake: (state: FormCarVehicleStateInterface, vehicleMake: string) => FormCarVehicleStateInterface;
|
|
8
8
|
export declare const setVehicleModel: (state: FormCarVehicleStateInterface, vehicleModel: string) => FormCarVehicleStateInterface;
|
|
9
|
-
export declare const setItemProperty: (state: FormCarVehicleStateInterface, name: string, value: string | boolean | VehicleConditionTypes) => FormCarVehicleStateInterface;
|
|
9
|
+
export declare const setItemProperty: (state: FormCarVehicleStateInterface, name: string, value: string | string[] | boolean | VehicleConditionTypes | VehicleAccidentBenefitsInterface) => FormCarVehicleStateInterface;
|
|
10
10
|
export declare const setCarCoverageProperty: (state: FormCarVehicleStateInterface, name: string, coverage: boolean, value: number) => FormCarVehicleStateInterface;
|
package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/initialState.d.ts
CHANGED
|
@@ -23,5 +23,10 @@ export declare const limitedWaiverOfDepreciationInitialState: {
|
|
|
23
23
|
coverage: boolean;
|
|
24
24
|
limit: number;
|
|
25
25
|
};
|
|
26
|
+
export declare const vehicleAccidentBenefitsInitialState: {
|
|
27
|
+
baseCoverage: string;
|
|
28
|
+
additionalCoverages: never[];
|
|
29
|
+
abAcknowledged: boolean;
|
|
30
|
+
};
|
|
26
31
|
export declare const vehicleItemInitialState: VehicleItemInterface;
|
|
27
32
|
export declare const carFormVehicleInitialState: FormCarVehicleStateInterface;
|
package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ export interface VehicleLimitedWaiverOfDepreciationInterface {
|
|
|
25
25
|
coverage: boolean;
|
|
26
26
|
limit: number;
|
|
27
27
|
}
|
|
28
|
+
export interface VehicleAccidentBenefitsInterface {
|
|
29
|
+
baseCoverage: string;
|
|
30
|
+
additionalCoverages: string[];
|
|
31
|
+
abAcknowledged?: boolean;
|
|
32
|
+
}
|
|
28
33
|
export interface VehicleItemInterface {
|
|
29
34
|
year: string | undefined;
|
|
30
35
|
make: string | undefined;
|
|
@@ -46,6 +51,7 @@ export interface VehicleItemInterface {
|
|
|
46
51
|
lossofuse: VehicleLossOfUseInterface;
|
|
47
52
|
liabilityfordamage: VehicleLiabilityForDamageInterface;
|
|
48
53
|
limitedwaiverofdepreciation: VehicleLimitedWaiverOfDepreciationInterface;
|
|
54
|
+
accidentbenefits: VehicleAccidentBenefitsInterface;
|
|
49
55
|
postalCode: string;
|
|
50
56
|
locationIndex: string;
|
|
51
57
|
city: string;
|
|
@@ -224,6 +230,28 @@ export type FormCarVehicleStateActionType = {
|
|
|
224
230
|
limit: number;
|
|
225
231
|
};
|
|
226
232
|
localIndex?: string;
|
|
233
|
+
} | {
|
|
234
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect;
|
|
235
|
+
payload: {
|
|
236
|
+
baseCoverage: string;
|
|
237
|
+
};
|
|
238
|
+
localIndex?: string;
|
|
239
|
+
} | {
|
|
240
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoveragesSet;
|
|
241
|
+
payload: {
|
|
242
|
+
additionalCoverages: string[];
|
|
243
|
+
};
|
|
244
|
+
localIndex?: string;
|
|
245
|
+
} | {
|
|
246
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoverageRemove;
|
|
247
|
+
payload: {
|
|
248
|
+
coverageValue: string;
|
|
249
|
+
};
|
|
250
|
+
localIndex?: string;
|
|
251
|
+
} | {
|
|
252
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAcknowledge;
|
|
253
|
+
payload?: null;
|
|
254
|
+
localIndex?: string;
|
|
227
255
|
};
|
|
228
256
|
export type FormCarVehicleStateReducerInterface = (state: FormCarVehicleStateInterface, action: FormCarVehicleStateActionType) => void;
|
|
229
257
|
export interface ClientHookInterface {
|
package/dist/esm/index.js
CHANGED
|
@@ -446,6 +446,11 @@ const limitedWaiverOfDepreciationInitialState = {
|
|
|
446
446
|
coverage: true,
|
|
447
447
|
limit: 1,
|
|
448
448
|
};
|
|
449
|
+
const vehicleAccidentBenefitsInitialState = {
|
|
450
|
+
baseCoverage: 'minimum_required',
|
|
451
|
+
additionalCoverages: [],
|
|
452
|
+
abAcknowledged: false,
|
|
453
|
+
};
|
|
449
454
|
const vehicleItemInitialState = {
|
|
450
455
|
year: '',
|
|
451
456
|
make: '',
|
|
@@ -468,6 +473,7 @@ const vehicleItemInitialState = {
|
|
|
468
473
|
lossofuse: { ...vehicleLossOfUseInitialState },
|
|
469
474
|
liabilityfordamage: { ...vehicleLiabilityForDamageInitialState },
|
|
470
475
|
limitedwaiverofdepreciation: { ...limitedWaiverOfDepreciationInitialState },
|
|
476
|
+
accidentbenefits: { ...vehicleAccidentBenefitsInitialState },
|
|
471
477
|
postalCode: '',
|
|
472
478
|
locationIndex: '',
|
|
473
479
|
city: '',
|
|
@@ -523,6 +529,10 @@ var StoreFormCarVehicleActionTypes;
|
|
|
523
529
|
StoreFormCarVehicleActionTypes["FormCarLossOfUseCoverageSelect"] = "FormCarLossOfUseCoverageSelect";
|
|
524
530
|
StoreFormCarVehicleActionTypes["FormCarLiabilityForDamageCoverageSelect"] = "FormCarLiabilityForDamageCoverageSelect";
|
|
525
531
|
StoreFormCarVehicleActionTypes["FormCarLimitedWaiverOfDepreciationCoverageSelect"] = "FormCarLimitedWaiverOfDepreciationCoverageSelect";
|
|
532
|
+
StoreFormCarVehicleActionTypes["FormCarAccidentBenefitsBaseCoverageSelect"] = "FormCarAccidentBenefitsBaseCoverageSelect";
|
|
533
|
+
StoreFormCarVehicleActionTypes["FormCarAccidentBenefitsAdditionalCoveragesSet"] = "FormCarAccidentBenefitsAdditionalCoveragesSet";
|
|
534
|
+
StoreFormCarVehicleActionTypes["FormCarAccidentBenefitsAdditionalCoverageRemove"] = "FormCarAccidentBenefitsAdditionalCoverageRemove";
|
|
535
|
+
StoreFormCarVehicleActionTypes["FormCarAccidentBenefitsAcknowledge"] = "FormCarAccidentBenefitsAcknowledge";
|
|
526
536
|
})(StoreFormCarVehicleActionTypes || (StoreFormCarVehicleActionTypes = {}));
|
|
527
537
|
|
|
528
538
|
const createTab = (name, id) => ({
|
|
@@ -556,6 +566,7 @@ const createVehicleItem = (state) => ({
|
|
|
556
566
|
comprehensive: state.items[0].comprehensive,
|
|
557
567
|
collision: state.items[0].collision,
|
|
558
568
|
liability: state.items[0].liability,
|
|
569
|
+
accidentbenefits: state.items[0].accidentbenefits,
|
|
559
570
|
},
|
|
560
571
|
],
|
|
561
572
|
tabs: [...state.tabs, { ...createTab('Vehicle', state.tabs.length) }],
|
|
@@ -687,6 +698,26 @@ const formCarVehicleStateReducer = (state = { ...carFormVehicleInitialState }, a
|
|
|
687
698
|
return setLocalVehicles(action.localIndex, setCarCoverageProperty(state, 'liabilityfordamage', action.payload.coverage, action.payload.limit));
|
|
688
699
|
case StoreFormCarVehicleActionTypes.FormCarLimitedWaiverOfDepreciationCoverageSelect:
|
|
689
700
|
return setLocalVehicles(action.localIndex, setCarCoverageProperty(state, 'limitedwaiverofdepreciation', action.payload.coverage, action.payload.limit));
|
|
701
|
+
case StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect:
|
|
702
|
+
return setLocalVehicles(action.localIndex, setItemProperty(state, 'accidentbenefits', {
|
|
703
|
+
...state.items[state.activeIndex].accidentbenefits,
|
|
704
|
+
baseCoverage: action.payload.baseCoverage,
|
|
705
|
+
}));
|
|
706
|
+
case StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoveragesSet:
|
|
707
|
+
return setLocalVehicles(action.localIndex, setItemProperty(state, 'accidentbenefits', {
|
|
708
|
+
...state.items[state.activeIndex].accidentbenefits,
|
|
709
|
+
additionalCoverages: action.payload.additionalCoverages,
|
|
710
|
+
}));
|
|
711
|
+
case StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoverageRemove:
|
|
712
|
+
return setLocalVehicles(action.localIndex, setItemProperty(state, 'accidentbenefits', {
|
|
713
|
+
...state.items[state.activeIndex].accidentbenefits,
|
|
714
|
+
additionalCoverages: state.items[state.activeIndex].accidentbenefits.additionalCoverages.filter((coverage) => coverage !== action.payload.coverageValue),
|
|
715
|
+
}));
|
|
716
|
+
case StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAcknowledge:
|
|
717
|
+
return setLocalVehicles(action.localIndex, setItemProperty(state, 'accidentbenefits', {
|
|
718
|
+
...state.items[state.activeIndex].accidentbenefits,
|
|
719
|
+
abAcknowledged: true,
|
|
720
|
+
}));
|
|
690
721
|
default:
|
|
691
722
|
return state;
|
|
692
723
|
}
|
|
@@ -3712,6 +3743,16 @@ const useProvince = () => {
|
|
|
3712
3743
|
isOntarioProvince: code === OntarioCode,
|
|
3713
3744
|
};
|
|
3714
3745
|
};
|
|
3746
|
+
const useAbReform = () => {
|
|
3747
|
+
const { isOntarioProvince } = useProvince();
|
|
3748
|
+
const { discountState } = useTypedSelector((state) => state).formCarState;
|
|
3749
|
+
const { policyStartYear, policyStartMonth, policyStartDay, policyStart, } = discountState;
|
|
3750
|
+
const policyStartDate = policyStartYear && policyStartMonth && policyStartDay
|
|
3751
|
+
? `${policyStartYear}-${policyStartMonth}-${policyStartDay}`
|
|
3752
|
+
: policyStart;
|
|
3753
|
+
const isAbReformActive = isOntarioProvince && policyStartDate >= '2026-07-01';
|
|
3754
|
+
return { isAbReformActive };
|
|
3755
|
+
};
|
|
3715
3756
|
|
|
3716
3757
|
const useStoreFormHomeQuote = () => {
|
|
3717
3758
|
const { appConfigState } = useStoreAppConfig();
|
|
@@ -5045,9 +5086,12 @@ const CarQuoteDataHandler = () => {
|
|
|
5045
5086
|
const postal = deepClone(postalState).item;
|
|
5046
5087
|
const discount = deepClone(discountState);
|
|
5047
5088
|
const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
|
|
5089
|
+
const policyStartDate = policyStartYear && policyStartMonth && policyStartDay
|
|
5090
|
+
? `${policyStartYear}-${policyStartMonth}-${policyStartDay}`
|
|
5091
|
+
: discountState.policyStart;
|
|
5048
5092
|
// dispatchQuoteState({ type: StoreFormCarQuoteActionTypes.UpdateCarCallMessage, payload: { showCallMessage: false } });
|
|
5049
5093
|
if (policyStartYear && policyStartMonth && policyStartDay) {
|
|
5050
|
-
discount.policyStart =
|
|
5094
|
+
discount.policyStart = policyStartDate;
|
|
5051
5095
|
delete discount.policyStartYear;
|
|
5052
5096
|
delete discount.policyStartMonth;
|
|
5053
5097
|
delete discount.policyStartDay;
|
|
@@ -5064,6 +5108,13 @@ const CarQuoteDataHandler = () => {
|
|
|
5064
5108
|
provinceName: postal.provinceName,
|
|
5065
5109
|
};
|
|
5066
5110
|
requestBody.quoterInfo.recalculate = isRecalc;
|
|
5111
|
+
const isAbReformEligible = requestBody.provinceCode === 'ON' && policyStartDate >= '2026-07-01';
|
|
5112
|
+
// Flag if any Accident Benefits buy-ups are selected (Ontario only)
|
|
5113
|
+
if (isRecalc && isAbReformEligible) {
|
|
5114
|
+
const hasAbChanges = vehicles.some((v) => v.accidentbenefits?.baseCoverage !== 'minimum_required'
|
|
5115
|
+
|| v.accidentbenefits?.additionalCoverages?.length > 0);
|
|
5116
|
+
requestBody.quoterInfo.accidentBenefitsChanged = hasAbChanges;
|
|
5117
|
+
}
|
|
5067
5118
|
delete requestBody.isValid;
|
|
5068
5119
|
delete requestBody.inValidation;
|
|
5069
5120
|
if (hasToBeConfirmed !== undefined) {
|
|
@@ -5273,7 +5324,20 @@ const CarQuoteDataHandler = () => {
|
|
|
5273
5324
|
vehicle.comprehensive.coverage = false;
|
|
5274
5325
|
vehicle.comprehensive.deductible = 1000;
|
|
5275
5326
|
}
|
|
5276
|
-
|
|
5327
|
+
const { accidentbenefits, ...vehiclePayload } = vehicle;
|
|
5328
|
+
const transformedVehicle = { ...vehiclePayload };
|
|
5329
|
+
if (accidentbenefits) {
|
|
5330
|
+
const { baseCoverage, additionalCoverages } = accidentbenefits;
|
|
5331
|
+
if (isAbReformEligible
|
|
5332
|
+
&& (baseCoverage !== 'minimum_required' || additionalCoverages.length > 0)) {
|
|
5333
|
+
transformedVehicle.accidentBenefits = {
|
|
5334
|
+
baseCoverage,
|
|
5335
|
+
additionalCoverages,
|
|
5336
|
+
};
|
|
5337
|
+
}
|
|
5338
|
+
}
|
|
5339
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5340
|
+
return transformedVehicle;
|
|
5277
5341
|
});
|
|
5278
5342
|
requestBody.vehlinks = localVehlinks;
|
|
5279
5343
|
return {
|
|
@@ -5854,6 +5918,7 @@ const useValidationVehicle = () => {
|
|
|
5854
5918
|
const { inValidation: vehicleFormIsInValidation = false, isValid: vehicleFormIsValid = false, } = vehicleState;
|
|
5855
5919
|
const { appConfigState } = useStoreAppConfig();
|
|
5856
5920
|
const { dispatchAppModalState } = useStoreAppModal();
|
|
5921
|
+
const { isAbReformActive } = useAbReform();
|
|
5857
5922
|
const navigate = useNavigate();
|
|
5858
5923
|
const vehicleFormValidate = (isRedirect = true) => {
|
|
5859
5924
|
let formIsValid = false;
|
|
@@ -5884,6 +5949,13 @@ const useValidationVehicle = () => {
|
|
|
5884
5949
|
return item;
|
|
5885
5950
|
});
|
|
5886
5951
|
});
|
|
5952
|
+
if (isAbReformActive) {
|
|
5953
|
+
vehicleState.items.forEach((item) => {
|
|
5954
|
+
if (!item.accidentbenefits.abAcknowledged) {
|
|
5955
|
+
errors.push('abAcknowledged');
|
|
5956
|
+
}
|
|
5957
|
+
});
|
|
5958
|
+
}
|
|
5887
5959
|
if (!errors.length) {
|
|
5888
5960
|
dispatchVehicleState({
|
|
5889
5961
|
type: StoreFormCarVehicleActionTypes.FormCarVehicleValidateSet,
|
|
@@ -5896,12 +5968,15 @@ const useValidationVehicle = () => {
|
|
|
5896
5968
|
formIsValid = true;
|
|
5897
5969
|
}
|
|
5898
5970
|
else {
|
|
5899
|
-
const element = document.getElementsByName(errors[0])[0];
|
|
5971
|
+
const element = document.getElementsByName(errors[0])[0] ?? document.getElementById(errors[0]);
|
|
5900
5972
|
element?.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
5973
|
+
const hasOnlyAbError = errors.every((e) => e === 'abAcknowledged');
|
|
5901
5974
|
dispatchAppModalState({
|
|
5902
5975
|
type: StoreConfigAppModalActionTypes.AppModalMessageModal,
|
|
5903
5976
|
payload: {
|
|
5904
|
-
title:
|
|
5977
|
+
title: hasOnlyAbError
|
|
5978
|
+
? 'Please review the Accident Benefits section'
|
|
5979
|
+
: 'Please enter missing values of required fields',
|
|
5905
5980
|
},
|
|
5906
5981
|
});
|
|
5907
5982
|
dispatchVehicleState({
|
|
@@ -6915,6 +6990,9 @@ const useAutofillCarForm = (options) => {
|
|
|
6915
6990
|
const { dispatchDriverCancellationState } = useStoreFormCarDriverCancellation();
|
|
6916
6991
|
const { dispatchDriverAccidentState } = useStoreFormCarDriverAccident();
|
|
6917
6992
|
const { dispatchDriverTicketState } = useStoreFormCarDriverTicket();
|
|
6993
|
+
const { dispatchDriverBaseState } = useStoreFormCarDriverBase();
|
|
6994
|
+
const { dispatchDiscountState } = useStoreFormCarDiscount();
|
|
6995
|
+
const { dispatchQuoteState } = useStoreFormCarQuote();
|
|
6918
6996
|
const { getVehicleMake } = useHandlerCarMake();
|
|
6919
6997
|
const { getVehicleModel } = useHandlerCarModel();
|
|
6920
6998
|
const { dispatchAppModalState } = useStoreAppModal();
|
|
@@ -6932,6 +7010,13 @@ const useAutofillCarForm = (options) => {
|
|
|
6932
7010
|
}
|
|
6933
7011
|
// Parse the autofill data
|
|
6934
7012
|
const autofillData = parseAutofillParam(autofillParam);
|
|
7013
|
+
// Clear all existing car form state before applying autofill data
|
|
7014
|
+
dispatchPostalState({ type: StoreFormCarPostalActionTypes.FormCarPostalClear });
|
|
7015
|
+
dispatchVehicleState({ type: StoreFormCarVehicleActionTypes.FormCarVehicleClear });
|
|
7016
|
+
dispatchConfigState({ type: StoreFormCarConfigActionTypes.FormCarConfigClear, payload: { province: '' } });
|
|
7017
|
+
dispatchDriverBaseState({ type: StoreFormCarDriverBaseActionTypes.FormCarDriverClear });
|
|
7018
|
+
dispatchDiscountState({ type: StoreFormCarDiscountActionTypes.FormCarDiscountClear });
|
|
7019
|
+
dispatchQuoteState({ type: StoreFormCarQuoteActionTypes.FormCarQuoteClear });
|
|
6935
7020
|
// Dispatch postal state
|
|
6936
7021
|
const postalData = mapToPostalState(autofillData);
|
|
6937
7022
|
dispatchPostalState({
|
|
@@ -7239,6 +7324,9 @@ const useAutofillCarForm = (options) => {
|
|
|
7239
7324
|
dispatchDriverCancellationState,
|
|
7240
7325
|
dispatchDriverAccidentState,
|
|
7241
7326
|
dispatchDriverTicketState,
|
|
7327
|
+
dispatchDriverBaseState,
|
|
7328
|
+
dispatchDiscountState,
|
|
7329
|
+
dispatchQuoteState,
|
|
7242
7330
|
dispatchAppModalState,
|
|
7243
7331
|
getVehicleMake,
|
|
7244
7332
|
getVehicleModel,
|
|
@@ -7252,6 +7340,7 @@ const useAutofillLifeForm = (options) => {
|
|
|
7252
7340
|
const { dispatchPostalState } = useStoreFormLifePostal();
|
|
7253
7341
|
const { dispatchCoverageState } = useStoreFormLifeCoverage();
|
|
7254
7342
|
const { dispatchApplicantState } = useStoreFormLifeApplicant();
|
|
7343
|
+
const { dispatchQuoteState } = useStoreFormLifeQuote();
|
|
7255
7344
|
const { dispatchAppModalState } = useStoreAppModal();
|
|
7256
7345
|
const autofillProcessedRef = useRef(false);
|
|
7257
7346
|
useEffect(() => {
|
|
@@ -7267,6 +7356,11 @@ const useAutofillLifeForm = (options) => {
|
|
|
7267
7356
|
}
|
|
7268
7357
|
// Parse the autofill data
|
|
7269
7358
|
const autofillData = parseLifeAutofillParam(autofillParam);
|
|
7359
|
+
// Clear all existing life form state before applying autofill data
|
|
7360
|
+
dispatchPostalState({ type: StoreFormLifePostalActionTypes.FormLifePostalClear });
|
|
7361
|
+
dispatchCoverageState({ type: StoreFormLifeCoverageActionTypes.FormLifeCoverageClear });
|
|
7362
|
+
dispatchApplicantState({ type: StoreFormLifeApplicantActionTypes.FormLifeApplicantClear });
|
|
7363
|
+
dispatchQuoteState({ type: StoreFormLifeQuoteActionTypes.FormLifeQuoteClear });
|
|
7270
7364
|
// Map and dispatch postal state
|
|
7271
7365
|
const postalData = mapToLifePostalState(autofillData);
|
|
7272
7366
|
dispatchPostalState({
|
|
@@ -7417,8 +7511,8 @@ const useAutofillLifeForm = (options) => {
|
|
|
7417
7511
|
// Silently fail - let the app continue with normal flow
|
|
7418
7512
|
console.error('Life autofill initialization error:', error);
|
|
7419
7513
|
}
|
|
7420
|
-
}, [dispatchPostalState, dispatchCoverageState, dispatchApplicantState, dispatchAppModalState]);
|
|
7514
|
+
}, [dispatchPostalState, dispatchCoverageState, dispatchApplicantState, dispatchQuoteState, dispatchAppModalState]);
|
|
7421
7515
|
};
|
|
7422
7516
|
|
|
7423
|
-
export { CarBrokerTypeEnum, CarQuoteDataHandler, ClearFormDataHandler, HomeBrokerTypeEnum, HomeQuoteDataHandler, LifeQuoteDataHandler, StoreClientActionTypes, StoreConfigAppConfigActionTypes, StoreConfigAppDeviceActionTypes, StoreConfigAppLoaderActionTypes, StoreConfigAppModalActionTypes, StoreFormCarConfigActionTypes, StoreFormCarDiscountActionTypes, StoreFormCarDriverAccidentActionTypes, StoreFormCarDriverBaseActionTypes, StoreFormCarDriverCancellationActionTypes, StoreFormCarDriverInfoActionTypes, StoreFormCarDriverInsuranceActionTypes, StoreFormCarDriverLicenceActionTypes, StoreFormCarDriverSuspensionActionTypes, StoreFormCarDriverTicketActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormCarVehicleActionTypes, StoreFormHomeApplicantBaseActionTypes, StoreFormHomeApplicantCancellationActionTypes, StoreFormHomeApplicantClaimActionTypes, StoreFormHomeApplicantInfoActionTypes, StoreFormHomeApplicantInsuranceActionTypes, StoreFormHomeDiscountActionTypes, StoreFormHomeDwellingActionTypes, StoreFormHomePostalActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifeApplicantActionTypes, StoreFormLifeCoverageActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StorePartnerActionTypes, StoreProvider, addDayToDate, configStateReducer, differenceInHoursFromNow, formCarReducer, formCondoDwellingInitialState, formHomeDwellingInitialState, formHomeReducer, formLifeReducer, formTenantDwellingInitialState, getDwellingInitialState, getProvinceCodeFromState, getProvinceName, globalStateReducer, initHttpResponse, mapToConfigState, mapToDriverState, mapToLifeApplicantState, mapToLifeCoverageState, mapToLifePostalState, mapToPostalState, mapToVehicleState, parseAutofillParam, parseLifeAutofillParam, reducers, default_1 as token, useAutofillCarForm, useAutofillLifeForm, useHandlerAuth, useHandlerCarMake, useHandlerCarModel, useHandlerCarQuoterEmail, useHandlerHomeQuoterEmail, useHandlerLifeQuoterEmail, useHandlerPartner, useHandlerPostal, useProvince, useStoreAppConfig, useStoreAppDevice, useStoreAppLoader, useStoreAppModal, useStoreClient, useStoreClientLoggedIn, useStoreClientProfile, useStoreClientToken, useStoreDeviceBP, useStoreDeviceType, useStoreFormCarConfig, useStoreFormCarDiscount, useStoreFormCarDriverAccident, useStoreFormCarDriverBase, useStoreFormCarDriverCancellation, useStoreFormCarDriverInfo, useStoreFormCarDriverInsurance, useStoreFormCarDriverLicence, useStoreFormCarDriverSuspension, useStoreFormCarDriverTicket, useStoreFormCarPostal, useStoreFormCarQuote, useStoreFormCarVehicle, useStoreFormHomeApplicantBase, useStoreFormHomeApplicantCancellation, useStoreFormHomeApplicantClaim, useStoreFormHomeApplicantInfo, useStoreFormHomeApplicantInsurance, useStoreFormHomeDiscount, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeQuote, useStoreFormLifeApplicant, useStoreFormLifeCoverage, useStoreFormLifePostal, useStoreFormLifeQuote, useStorePartner, useValidationAddress, useValidationApplicant, useValidationCarDiscount, useValidationCoverage, useValidationDriver, useValidationDwelling, useValidationHomeDiscount, useValidationLifeApplicant, useValidationVehicle };
|
|
7517
|
+
export { CarBrokerTypeEnum, CarQuoteDataHandler, ClearFormDataHandler, HomeBrokerTypeEnum, HomeQuoteDataHandler, LifeQuoteDataHandler, StoreClientActionTypes, StoreConfigAppConfigActionTypes, StoreConfigAppDeviceActionTypes, StoreConfigAppLoaderActionTypes, StoreConfigAppModalActionTypes, StoreFormCarConfigActionTypes, StoreFormCarDiscountActionTypes, StoreFormCarDriverAccidentActionTypes, StoreFormCarDriverBaseActionTypes, StoreFormCarDriverCancellationActionTypes, StoreFormCarDriverInfoActionTypes, StoreFormCarDriverInsuranceActionTypes, StoreFormCarDriverLicenceActionTypes, StoreFormCarDriverSuspensionActionTypes, StoreFormCarDriverTicketActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormCarVehicleActionTypes, StoreFormHomeApplicantBaseActionTypes, StoreFormHomeApplicantCancellationActionTypes, StoreFormHomeApplicantClaimActionTypes, StoreFormHomeApplicantInfoActionTypes, StoreFormHomeApplicantInsuranceActionTypes, StoreFormHomeDiscountActionTypes, StoreFormHomeDwellingActionTypes, StoreFormHomePostalActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifeApplicantActionTypes, StoreFormLifeCoverageActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StorePartnerActionTypes, StoreProvider, addDayToDate, configStateReducer, differenceInHoursFromNow, formCarReducer, formCondoDwellingInitialState, formHomeDwellingInitialState, formHomeReducer, formLifeReducer, formTenantDwellingInitialState, getDwellingInitialState, getProvinceCodeFromState, getProvinceName, globalStateReducer, initHttpResponse, mapToConfigState, mapToDriverState, mapToLifeApplicantState, mapToLifeCoverageState, mapToLifePostalState, mapToPostalState, mapToVehicleState, parseAutofillParam, parseLifeAutofillParam, reducers, default_1 as token, useAbReform, useAutofillCarForm, useAutofillLifeForm, useHandlerAuth, useHandlerCarMake, useHandlerCarModel, useHandlerCarQuoterEmail, useHandlerHomeQuoterEmail, useHandlerLifeQuoterEmail, useHandlerPartner, useHandlerPostal, useProvince, useStoreAppConfig, useStoreAppDevice, useStoreAppLoader, useStoreAppModal, useStoreClient, useStoreClientLoggedIn, useStoreClientProfile, useStoreClientToken, useStoreDeviceBP, useStoreDeviceType, useStoreFormCarConfig, useStoreFormCarDiscount, useStoreFormCarDriverAccident, useStoreFormCarDriverBase, useStoreFormCarDriverCancellation, useStoreFormCarDriverInfo, useStoreFormCarDriverInsurance, useStoreFormCarDriverLicence, useStoreFormCarDriverSuspension, useStoreFormCarDriverTicket, useStoreFormCarPostal, useStoreFormCarQuote, useStoreFormCarVehicle, useStoreFormHomeApplicantBase, useStoreFormHomeApplicantCancellation, useStoreFormHomeApplicantClaim, useStoreFormHomeApplicantInfo, useStoreFormHomeApplicantInsurance, useStoreFormHomeDiscount, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeQuote, useStoreFormLifeApplicant, useStoreFormLifeCoverage, useStoreFormLifePostal, useStoreFormLifeQuote, useStorePartner, useValidationAddress, useValidationApplicant, useValidationCarDiscount, useValidationCoverage, useValidationDriver, useValidationDwelling, useValidationHomeDiscount, useValidationLifeApplicant, useValidationVehicle };
|
|
7424
7518
|
//# sourceMappingURL=index.js.map
|