@mychoice/mychoice-sdk-store 2.1.86 → 2.2.5
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 +19 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/actions.d.ts +1 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +6 -0
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DiscountState/actions.d.ts +1 -0
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +6 -0
- package/dist/cjs/states/reducers/states/formStates/FormLifeState/ApplicantState/actions.d.ts +2 -1
- package/dist/cjs/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +6 -0
- package/dist/esm/index.js +19 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DiscountState/actions.d.ts +1 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +6 -0
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DiscountState/actions.d.ts +1 -0
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +6 -0
- package/dist/esm/states/reducers/states/formStates/FormLifeState/ApplicantState/actions.d.ts +2 -1
- package/dist/esm/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +6 -0
- package/dist/index.d.ts +22 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1887,6 +1887,7 @@ exports.StoreFormCarDiscountActionTypes = void 0;
|
|
|
1887
1887
|
StoreFormCarDiscountActionTypes["FormCarDiscountQuoterBrokerInfoSet"] = "FormCarDiscountQuoterBrokerInfoSet";
|
|
1888
1888
|
StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmSourceSet"] = "FormCarDiscountQuoterUtmSourceSet";
|
|
1889
1889
|
StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmCampaignSet"] = "FormCarDiscountQuoterUtmCampaignSet";
|
|
1890
|
+
StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmProducerSet"] = "FormCarDiscountQuoterUtmProducerSet";
|
|
1890
1891
|
StoreFormCarDiscountActionTypes["FormCarDiscountQuoterInitialSet"] = "FormCarDiscountQuoterInitialSet";
|
|
1891
1892
|
})(exports.StoreFormCarDiscountActionTypes || (exports.StoreFormCarDiscountActionTypes = {}));
|
|
1892
1893
|
|
|
@@ -2018,6 +2019,8 @@ const formCarDiscountStateReducer = (state = { ...formCarDiscountStateInitialSta
|
|
|
2018
2019
|
return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmSource', action.payload.utmSource));
|
|
2019
2020
|
case exports.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterUtmCampaignSet:
|
|
2020
2021
|
return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmCampaign', action.payload.utmCampaign));
|
|
2022
|
+
case exports.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterUtmProducerSet:
|
|
2023
|
+
return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmProducer', action.payload.utmProducer));
|
|
2021
2024
|
case exports.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterInitialSet:
|
|
2022
2025
|
return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'initial', action.payload.initial));
|
|
2023
2026
|
case exports.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet:
|
|
@@ -2862,6 +2865,7 @@ exports.StoreFormHomeDiscountActionTypes = void 0;
|
|
|
2862
2865
|
StoreFormHomeDiscountActionTypes["FormHomeQuoterPhoneSet"] = "FormHomeQuoterPhoneSet";
|
|
2863
2866
|
StoreFormHomeDiscountActionTypes["FormHomeUtmCampaignSet"] = "FormHomeUtmCampaignSet";
|
|
2864
2867
|
StoreFormHomeDiscountActionTypes["FormHomeUtmSourceSet"] = "FormHomeUtmSourceSet";
|
|
2868
|
+
StoreFormHomeDiscountActionTypes["FormHomeUtmProducerSet"] = "FormHomeUtmProducerSet";
|
|
2865
2869
|
StoreFormHomeDiscountActionTypes["FormHomeQuoterBrokerInfoSet"] = "FormHomeQuoterBrokerInfoSet";
|
|
2866
2870
|
StoreFormHomeDiscountActionTypes["FormHomeDiscountQuoterInitialSet"] = "FormHomeDiscountQuoterInitialSet";
|
|
2867
2871
|
})(exports.StoreFormHomeDiscountActionTypes || (exports.StoreFormHomeDiscountActionTypes = {}));
|
|
@@ -2923,6 +2927,8 @@ const formHomeDiscountStateReducer = (state = { ...formHomeDiscountStateInitialS
|
|
|
2923
2927
|
return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmSource', action.payload.utmSource, 'quoterInfo'));
|
|
2924
2928
|
case exports.StoreFormHomeDiscountActionTypes.FormHomeUtmCampaignSet:
|
|
2925
2929
|
return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmCampaign', action.payload.utmCampaign, 'quoterInfo'));
|
|
2930
|
+
case exports.StoreFormHomeDiscountActionTypes.FormHomeUtmProducerSet:
|
|
2931
|
+
return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmProducer', action.payload.utmProducer, 'quoterInfo'));
|
|
2926
2932
|
case exports.StoreFormHomeDiscountActionTypes.FormHomeDiscountQuoterInitialSet:
|
|
2927
2933
|
return setLocalDiscounts(action.localIndex, setStateProperty(state, 'initial', action.payload.initial, 'quoterInfo'));
|
|
2928
2934
|
case exports.StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet:
|
|
@@ -3110,6 +3116,7 @@ exports.StoreFormLifeApplicantActionTypes = void 0;
|
|
|
3110
3116
|
StoreFormLifeApplicantActionTypes["FormLifeQuoterPhoneSet"] = "FormLifeQuoterPhoneSet";
|
|
3111
3117
|
StoreFormLifeApplicantActionTypes["FormLifeUtmCampaignSet"] = "FormLifeUtmCampaignSet";
|
|
3112
3118
|
StoreFormLifeApplicantActionTypes["FormLifeUtmSourceSet"] = "FormLifeUtmSourceSet";
|
|
3119
|
+
StoreFormLifeApplicantActionTypes["FormLifeUtmProducerSet"] = "FormLifeUtmProducerSet";
|
|
3113
3120
|
})(exports.StoreFormLifeApplicantActionTypes || (exports.StoreFormLifeApplicantActionTypes = {}));
|
|
3114
3121
|
|
|
3115
3122
|
const formLifeApplicantStateReducer = (state = { ...lifeFormApplicantInitialState }, action) => {
|
|
@@ -3147,6 +3154,8 @@ const formLifeApplicantStateReducer = (state = { ...lifeFormApplicantInitialStat
|
|
|
3147
3154
|
return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmSource', action.payload.utmSource, 'quoterInfo'));
|
|
3148
3155
|
case exports.StoreFormLifeApplicantActionTypes.FormLifeUtmCampaignSet:
|
|
3149
3156
|
return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmCampaign', action.payload.utmCampaign, 'quoterInfo'));
|
|
3157
|
+
case exports.StoreFormLifeApplicantActionTypes.FormLifeUtmProducerSet:
|
|
3158
|
+
return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmProducer', action.payload.utmProducer, 'quoterInfo'));
|
|
3150
3159
|
default:
|
|
3151
3160
|
return state;
|
|
3152
3161
|
}
|
|
@@ -5445,7 +5454,7 @@ const HomeQuoteDataHandler = () => {
|
|
|
5445
5454
|
const navigate = reactRouterDom.useNavigate();
|
|
5446
5455
|
const { checkIsExpired, checkIsExpiredWithModal } = ClearFormDataHandler();
|
|
5447
5456
|
const [requestState, setRequestState] = react.useReducer(dataHandlerReducer, { ...initialHandlerRequestState });
|
|
5448
|
-
const { status, successMessage, responseData, errorMessage, isFirstRequest, responseError
|
|
5457
|
+
const { status, successMessage, responseData, errorMessage, isFirstRequest, responseError } = requestState;
|
|
5449
5458
|
const { cancelToken } = useCancelToken();
|
|
5450
5459
|
const openLoader = (loaderDescription = '') => {
|
|
5451
5460
|
dispatchAppLoaderState({
|
|
@@ -5461,8 +5470,8 @@ const HomeQuoteDataHandler = () => {
|
|
|
5461
5470
|
const dwelling = mychoiceSdkComponents.deepClone(dwellingState);
|
|
5462
5471
|
const discount = mychoiceSdkComponents.deepClone(discountState);
|
|
5463
5472
|
const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
|
|
5464
|
-
const { builtYear, roofReplacedYear, occupiedYear
|
|
5465
|
-
const { insured: { dateInsuredCurrent, dateInsuredSince, birthMonth, birthDay, birthYear, nonsmoker
|
|
5473
|
+
const { builtYear, roofReplacedYear, occupiedYear } = dwellingState;
|
|
5474
|
+
const { insured: { dateInsuredCurrent, dateInsuredSince, birthMonth, birthDay, birthYear, nonsmoker }, insuranceClaimList, insuranceCancellationList, } = applicant;
|
|
5466
5475
|
const lists = {
|
|
5467
5476
|
claims: insuranceClaimList?.map((item) => ({
|
|
5468
5477
|
date: addDayToDate(`${item.claimYear}-${item.claimMonth}`, 1),
|
|
@@ -5495,7 +5504,7 @@ const HomeQuoteDataHandler = () => {
|
|
|
5495
5504
|
dwelling.liability = Number(dwelling.liability);
|
|
5496
5505
|
dwelling.fireHydrantDistance = Number(dwelling.fireHydrantDistance);
|
|
5497
5506
|
dwelling.fireHallDistance = Number(dwelling.fireHallDistance);
|
|
5498
|
-
if (
|
|
5507
|
+
if (insuranceType !== mychoiceSdkComponents.InsuranceTypes.Home && dwelling.pp) {
|
|
5499
5508
|
dwelling.replacementCost = Number(dwelling.pp);
|
|
5500
5509
|
}
|
|
5501
5510
|
const heatingExpectedDate = mychoiceSdkComponents.subYearsFromDate('', 20);
|
|
@@ -5537,14 +5546,16 @@ const HomeQuoteDataHandler = () => {
|
|
|
5537
5546
|
delete discount.policyStartDay;
|
|
5538
5547
|
}
|
|
5539
5548
|
const requestBody = {
|
|
5540
|
-
dwellings: [
|
|
5549
|
+
dwellings: [
|
|
5550
|
+
{
|
|
5541
5551
|
...dwelling,
|
|
5542
5552
|
postalCode: postal.postalCode,
|
|
5543
5553
|
locationIndex: postal.locationIndex,
|
|
5544
5554
|
city: postal.city,
|
|
5545
5555
|
streetAddress: postal.streetAddress,
|
|
5546
5556
|
...lists,
|
|
5547
|
-
}
|
|
5557
|
+
},
|
|
5558
|
+
],
|
|
5548
5559
|
...discount,
|
|
5549
5560
|
insured: {
|
|
5550
5561
|
dateOfBirth: `${birthYear}-${birthMonth}-${birthDay}`,
|
|
@@ -5680,7 +5691,7 @@ const HomeQuoteDataHandler = () => {
|
|
|
5680
5691
|
}
|
|
5681
5692
|
}
|
|
5682
5693
|
};
|
|
5683
|
-
return
|
|
5694
|
+
return {
|
|
5684
5695
|
status,
|
|
5685
5696
|
successMessage,
|
|
5686
5697
|
responseData,
|
|
@@ -5689,7 +5700,7 @@ const HomeQuoteDataHandler = () => {
|
|
|
5689
5700
|
responseError,
|
|
5690
5701
|
postRequestQuoteOnliaUrl,
|
|
5691
5702
|
postRequestQuote,
|
|
5692
|
-
}
|
|
5703
|
+
};
|
|
5693
5704
|
};
|
|
5694
5705
|
|
|
5695
5706
|
const LifeQuoteDataHandler = () => {
|