@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.
@@ -23,5 +23,6 @@ export declare enum StoreFormCarDiscountActionTypes {
23
23
  FormCarDiscountQuoterBrokerInfoSet = "FormCarDiscountQuoterBrokerInfoSet",
24
24
  FormCarDiscountQuoterUtmSourceSet = "FormCarDiscountQuoterUtmSourceSet",
25
25
  FormCarDiscountQuoterUtmCampaignSet = "FormCarDiscountQuoterUtmCampaignSet",
26
+ FormCarDiscountQuoterUtmProducerSet = "FormCarDiscountQuoterUtmProducerSet",
26
27
  FormCarDiscountQuoterInitialSet = "FormCarDiscountQuoterInitialSet"
27
28
  }
@@ -131,6 +131,12 @@ export type FormCarDiscountStateActionType = {
131
131
  utmCampaign: string;
132
132
  };
133
133
  localIndex?: string;
134
+ } | {
135
+ type: StoreFormCarDiscountActionTypes.FormCarDiscountQuoterUtmProducerSet;
136
+ payload: {
137
+ utmProducer: string;
138
+ };
139
+ localIndex?: string;
134
140
  } | {
135
141
  type: StoreFormCarDiscountActionTypes.FormCarDiscountQuoterInitialSet;
136
142
  payload: {
@@ -15,6 +15,7 @@ export declare enum StoreFormHomeDiscountActionTypes {
15
15
  FormHomeQuoterPhoneSet = "FormHomeQuoterPhoneSet",
16
16
  FormHomeUtmCampaignSet = "FormHomeUtmCampaignSet",
17
17
  FormHomeUtmSourceSet = "FormHomeUtmSourceSet",
18
+ FormHomeUtmProducerSet = "FormHomeUtmProducerSet",
18
19
  FormHomeQuoterBrokerInfoSet = "FormHomeQuoterBrokerInfoSet",
19
20
  FormHomeDiscountQuoterInitialSet = "FormHomeDiscountQuoterInitialSet"
20
21
  }
@@ -86,6 +86,12 @@ export type FormHomeDiscountStateActionType = {
86
86
  utmSource: string;
87
87
  };
88
88
  localIndex?: string;
89
+ } | {
90
+ type: StoreFormHomeDiscountActionTypes.FormHomeUtmProducerSet;
91
+ payload: {
92
+ utmProducer: string;
93
+ };
94
+ localIndex?: string;
89
95
  } | {
90
96
  type: StoreFormHomeDiscountActionTypes.FormHomeDiscountQuoterInitialSet;
91
97
  payload: {
@@ -14,5 +14,6 @@ export declare enum StoreFormLifeApplicantActionTypes {
14
14
  FormLifeQuoterLastNameSet = "FormLifeQuoterLastNameSet",
15
15
  FormLifeQuoterPhoneSet = "FormLifeQuoterPhoneSet",
16
16
  FormLifeUtmCampaignSet = "FormLifeUtmCampaignSet",
17
- FormLifeUtmSourceSet = "FormLifeUtmSourceSet"
17
+ FormLifeUtmSourceSet = "FormLifeUtmSourceSet",
18
+ FormLifeUtmProducerSet = "FormLifeUtmProducerSet"
18
19
  }
@@ -103,6 +103,12 @@ export type FormLifeApplicantStateActionType = {
103
103
  utmSource: string;
104
104
  };
105
105
  localIndex?: string;
106
+ } | {
107
+ type: StoreFormLifeApplicantActionTypes.FormLifeUtmProducerSet;
108
+ payload: {
109
+ utmProducer: string;
110
+ };
111
+ localIndex?: string;
106
112
  } | {
107
113
  type: StoreFormLifeApplicantActionTypes.FormLifeApplicantClear;
108
114
  payload?: null;
package/dist/esm/index.js CHANGED
@@ -1878,6 +1878,7 @@ var StoreFormCarDiscountActionTypes;
1878
1878
  StoreFormCarDiscountActionTypes["FormCarDiscountQuoterBrokerInfoSet"] = "FormCarDiscountQuoterBrokerInfoSet";
1879
1879
  StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmSourceSet"] = "FormCarDiscountQuoterUtmSourceSet";
1880
1880
  StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmCampaignSet"] = "FormCarDiscountQuoterUtmCampaignSet";
1881
+ StoreFormCarDiscountActionTypes["FormCarDiscountQuoterUtmProducerSet"] = "FormCarDiscountQuoterUtmProducerSet";
1881
1882
  StoreFormCarDiscountActionTypes["FormCarDiscountQuoterInitialSet"] = "FormCarDiscountQuoterInitialSet";
1882
1883
  })(StoreFormCarDiscountActionTypes || (StoreFormCarDiscountActionTypes = {}));
1883
1884
 
@@ -2009,6 +2010,8 @@ const formCarDiscountStateReducer = (state = { ...formCarDiscountStateInitialSta
2009
2010
  return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmSource', action.payload.utmSource));
2010
2011
  case StoreFormCarDiscountActionTypes.FormCarDiscountQuoterUtmCampaignSet:
2011
2012
  return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmCampaign', action.payload.utmCampaign));
2013
+ case StoreFormCarDiscountActionTypes.FormCarDiscountQuoterUtmProducerSet:
2014
+ return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'utmProducer', action.payload.utmProducer));
2012
2015
  case StoreFormCarDiscountActionTypes.FormCarDiscountQuoterInitialSet:
2013
2016
  return setLocalDiscounts$1(action.localIndex, setDiscountQuoterProperty(state, 'initial', action.payload.initial));
2014
2017
  case StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet:
@@ -2853,6 +2856,7 @@ var StoreFormHomeDiscountActionTypes;
2853
2856
  StoreFormHomeDiscountActionTypes["FormHomeQuoterPhoneSet"] = "FormHomeQuoterPhoneSet";
2854
2857
  StoreFormHomeDiscountActionTypes["FormHomeUtmCampaignSet"] = "FormHomeUtmCampaignSet";
2855
2858
  StoreFormHomeDiscountActionTypes["FormHomeUtmSourceSet"] = "FormHomeUtmSourceSet";
2859
+ StoreFormHomeDiscountActionTypes["FormHomeUtmProducerSet"] = "FormHomeUtmProducerSet";
2856
2860
  StoreFormHomeDiscountActionTypes["FormHomeQuoterBrokerInfoSet"] = "FormHomeQuoterBrokerInfoSet";
2857
2861
  StoreFormHomeDiscountActionTypes["FormHomeDiscountQuoterInitialSet"] = "FormHomeDiscountQuoterInitialSet";
2858
2862
  })(StoreFormHomeDiscountActionTypes || (StoreFormHomeDiscountActionTypes = {}));
@@ -2914,6 +2918,8 @@ const formHomeDiscountStateReducer = (state = { ...formHomeDiscountStateInitialS
2914
2918
  return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmSource', action.payload.utmSource, 'quoterInfo'));
2915
2919
  case StoreFormHomeDiscountActionTypes.FormHomeUtmCampaignSet:
2916
2920
  return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmCampaign', action.payload.utmCampaign, 'quoterInfo'));
2921
+ case StoreFormHomeDiscountActionTypes.FormHomeUtmProducerSet:
2922
+ return setLocalDiscounts(action.localIndex, setStateProperty(state, 'utmProducer', action.payload.utmProducer, 'quoterInfo'));
2917
2923
  case StoreFormHomeDiscountActionTypes.FormHomeDiscountQuoterInitialSet:
2918
2924
  return setLocalDiscounts(action.localIndex, setStateProperty(state, 'initial', action.payload.initial, 'quoterInfo'));
2919
2925
  case StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet:
@@ -3101,6 +3107,7 @@ var StoreFormLifeApplicantActionTypes;
3101
3107
  StoreFormLifeApplicantActionTypes["FormLifeQuoterPhoneSet"] = "FormLifeQuoterPhoneSet";
3102
3108
  StoreFormLifeApplicantActionTypes["FormLifeUtmCampaignSet"] = "FormLifeUtmCampaignSet";
3103
3109
  StoreFormLifeApplicantActionTypes["FormLifeUtmSourceSet"] = "FormLifeUtmSourceSet";
3110
+ StoreFormLifeApplicantActionTypes["FormLifeUtmProducerSet"] = "FormLifeUtmProducerSet";
3104
3111
  })(StoreFormLifeApplicantActionTypes || (StoreFormLifeApplicantActionTypes = {}));
3105
3112
 
3106
3113
  const formLifeApplicantStateReducer = (state = { ...lifeFormApplicantInitialState }, action) => {
@@ -3138,6 +3145,8 @@ const formLifeApplicantStateReducer = (state = { ...lifeFormApplicantInitialStat
3138
3145
  return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmSource', action.payload.utmSource, 'quoterInfo'));
3139
3146
  case StoreFormLifeApplicantActionTypes.FormLifeUtmCampaignSet:
3140
3147
  return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmCampaign', action.payload.utmCampaign, 'quoterInfo'));
3148
+ case StoreFormLifeApplicantActionTypes.FormLifeUtmProducerSet:
3149
+ return setLocalApplicant(action?.localIndex, setStateProperty(state, 'utmProducer', action.payload.utmProducer, 'quoterInfo'));
3141
3150
  default:
3142
3151
  return state;
3143
3152
  }
@@ -5436,7 +5445,7 @@ const HomeQuoteDataHandler = () => {
5436
5445
  const navigate = useNavigate();
5437
5446
  const { checkIsExpired, checkIsExpiredWithModal } = ClearFormDataHandler();
5438
5447
  const [requestState, setRequestState] = useReducer(dataHandlerReducer, { ...initialHandlerRequestState });
5439
- const { status, successMessage, responseData, errorMessage, isFirstRequest, responseError, } = requestState;
5448
+ const { status, successMessage, responseData, errorMessage, isFirstRequest, responseError } = requestState;
5440
5449
  const { cancelToken } = useCancelToken();
5441
5450
  const openLoader = (loaderDescription = '') => {
5442
5451
  dispatchAppLoaderState({
@@ -5452,8 +5461,8 @@ const HomeQuoteDataHandler = () => {
5452
5461
  const dwelling = deepClone(dwellingState);
5453
5462
  const discount = deepClone(discountState);
5454
5463
  const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
5455
- const { builtYear, roofReplacedYear, occupiedYear, } = dwellingState;
5456
- const { insured: { dateInsuredCurrent, dateInsuredSince, birthMonth, birthDay, birthYear, nonsmoker, }, insuranceClaimList, insuranceCancellationList, } = applicant;
5464
+ const { builtYear, roofReplacedYear, occupiedYear } = dwellingState;
5465
+ const { insured: { dateInsuredCurrent, dateInsuredSince, birthMonth, birthDay, birthYear, nonsmoker }, insuranceClaimList, insuranceCancellationList, } = applicant;
5457
5466
  const lists = {
5458
5467
  claims: insuranceClaimList?.map((item) => ({
5459
5468
  date: addDayToDate(`${item.claimYear}-${item.claimMonth}`, 1),
@@ -5486,7 +5495,7 @@ const HomeQuoteDataHandler = () => {
5486
5495
  dwelling.liability = Number(dwelling.liability);
5487
5496
  dwelling.fireHydrantDistance = Number(dwelling.fireHydrantDistance);
5488
5497
  dwelling.fireHallDistance = Number(dwelling.fireHallDistance);
5489
- if ((insuranceType !== InsuranceTypes.Home) && dwelling.pp) {
5498
+ if (insuranceType !== InsuranceTypes.Home && dwelling.pp) {
5490
5499
  dwelling.replacementCost = Number(dwelling.pp);
5491
5500
  }
5492
5501
  const heatingExpectedDate = subYearsFromDate('', 20);
@@ -5528,14 +5537,16 @@ const HomeQuoteDataHandler = () => {
5528
5537
  delete discount.policyStartDay;
5529
5538
  }
5530
5539
  const requestBody = {
5531
- dwellings: [{
5540
+ dwellings: [
5541
+ {
5532
5542
  ...dwelling,
5533
5543
  postalCode: postal.postalCode,
5534
5544
  locationIndex: postal.locationIndex,
5535
5545
  city: postal.city,
5536
5546
  streetAddress: postal.streetAddress,
5537
5547
  ...lists,
5538
- }],
5548
+ },
5549
+ ],
5539
5550
  ...discount,
5540
5551
  insured: {
5541
5552
  dateOfBirth: `${birthYear}-${birthMonth}-${birthDay}`,
@@ -5671,7 +5682,7 @@ const HomeQuoteDataHandler = () => {
5671
5682
  }
5672
5683
  }
5673
5684
  };
5674
- return ({
5685
+ return {
5675
5686
  status,
5676
5687
  successMessage,
5677
5688
  responseData,
@@ -5680,7 +5691,7 @@ const HomeQuoteDataHandler = () => {
5680
5691
  responseError,
5681
5692
  postRequestQuoteOnliaUrl,
5682
5693
  postRequestQuote,
5683
- });
5694
+ };
5684
5695
  };
5685
5696
 
5686
5697
  const LifeQuoteDataHandler = () => {