@mychoice/mychoice-sdk-store 2.1.71 → 2.1.75

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.
@@ -1 +1,2 @@
1
- export type { FormCarQuoteStateInterface, FormCarQuoteStateReducerInterface, CarQuoteItemInterface, CarQuoteCoverageInterface, } from './interfaces';
1
+ export type { FormCarQuoteStateInterface, FormCarQuoteStateReducerInterface, CarQuoteItemInterface, CarQuoteCoverageInterface, CarBrokerIntegrationInterface, } from './interfaces';
2
+ export { CarBrokerTypeEnum } from './interfaces';
@@ -1,4 +1,7 @@
1
1
  import { StoreFormCarQuoteActionTypes } from './actions';
2
+ export declare enum CarBrokerTypeEnum {
3
+ Youset = "youset"
4
+ }
2
5
  export interface BrokerProfileInterface {
3
6
  description: string;
4
7
  hoursSaturday: string;
@@ -21,6 +24,10 @@ export interface CarQuoteCoverageInterface {
21
24
  limit1: string;
22
25
  limit2: string;
23
26
  }
27
+ export interface CarBrokerIntegrationInterface {
28
+ type: CarBrokerTypeEnum;
29
+ data: Record<string, any>;
30
+ }
24
31
  export interface CarQuoteItemInterface {
25
32
  brokerProfile: BrokerProfileInterface;
26
33
  company: QuoteCompanyInterface;
@@ -36,6 +43,7 @@ export interface CarQuoteItemInterface {
36
43
  43: boolean;
37
44
  aCCW: boolean;
38
45
  };
46
+ brokerIntegration?: CarBrokerIntegrationInterface;
39
47
  }
40
48
  export interface FormCarQuoteStateInterface {
41
49
  items: CarQuoteItemInterface[];
@@ -1 +1,2 @@
1
- export type { FormHomeQuoteStateInterface, FormHomeQuoteStateReducerInterface, HomeQuoteItemInterface, } from './interfaces';
1
+ export type { FormHomeQuoteStateInterface, FormHomeQuoteStateReducerInterface, HomeQuoteItemInterface, HomeBrokerIntegrationInterface, } from './interfaces';
2
+ export { HomeBrokerTypeEnum } from './interfaces';
@@ -1,4 +1,11 @@
1
1
  import { StoreFormHomeQuoteActionTypes } from './actions';
2
+ export declare enum HomeBrokerTypeEnum {
3
+ Youset = "youset"
4
+ }
5
+ export interface HomeBrokerIntegrationInterface {
6
+ type: HomeBrokerTypeEnum;
7
+ data: Record<string, any>;
8
+ }
2
9
  export interface BrokerProfileInterface {
3
10
  description: string;
4
11
  hoursSaturday: string;
@@ -22,6 +29,7 @@ export interface HomeQuoteItemInterface {
22
29
  priceMonthly: string;
23
30
  priceYearly: string;
24
31
  fulfillmentUrl: string;
32
+ brokerIntegration?: HomeBrokerIntegrationInterface;
25
33
  }
26
34
  export interface FormHomeQuoteStateInterface {
27
35
  items: HomeQuoteItemInterface[];
package/dist/esm/index.js CHANGED
@@ -417,6 +417,11 @@ const globalStateReducer = combineReducers({
417
417
  partnerState: partnerStateReducer,
418
418
  });
419
419
 
420
+ var CarBrokerTypeEnum;
421
+ (function (CarBrokerTypeEnum) {
422
+ CarBrokerTypeEnum["Youset"] = "youset";
423
+ })(CarBrokerTypeEnum || (CarBrokerTypeEnum = {}));
424
+
420
425
  const vehicleComprehensiveInitialState = {
421
426
  coverage: true,
422
427
  deductible: 1000,
@@ -2243,6 +2248,11 @@ const getDwellingInitialState = (type) => {
2243
2248
  }
2244
2249
  };
2245
2250
 
2251
+ var HomeBrokerTypeEnum;
2252
+ (function (HomeBrokerTypeEnum) {
2253
+ HomeBrokerTypeEnum["Youset"] = "youset";
2254
+ })(HomeBrokerTypeEnum || (HomeBrokerTypeEnum = {}));
2255
+
2246
2256
  const formHomePostalInitialState = {
2247
2257
  isReady: false,
2248
2258
  item: {
@@ -6093,6 +6103,8 @@ const useValidationCarDiscount = () => {
6093
6103
  };
6094
6104
  };
6095
6105
 
6106
+ // Module-level flag to prevent duplicate OPTA calls
6107
+ let isOPTACallInProgress = false;
6096
6108
  const useValidationAddress = () => {
6097
6109
  const { dwellingState } = useStoreFormHomeDwelling();
6098
6110
  const { dispatchAppLoaderState } = useStoreAppLoader();
@@ -6127,14 +6139,8 @@ const useValidationAddress = () => {
6127
6139
  });
6128
6140
  if (!errors.length) {
6129
6141
  if (isHomeOwner) {
6130
- try {
6131
- dispatchAppLoaderState({
6132
- type: StoreConfigAppLoaderActionTypes.AppLoaderOpen,
6133
- payload: {
6134
- description: '',
6135
- },
6136
- });
6137
- await getPlaceByAddress(streetAddress, city, postalCode, provinceCode);
6142
+ // Check if OPTA call is already in progress to prevent duplicates
6143
+ if (isOPTACallInProgress) {
6138
6144
  dispatchPostalState({
6139
6145
  type: StoreFormHomePostalActionTypes.FormHomePostalValidate,
6140
6146
  payload: { inValidation: false },
@@ -6144,23 +6150,46 @@ const useValidationAddress = () => {
6144
6150
  payload: { isValid: true },
6145
6151
  });
6146
6152
  formIsValid = true;
6147
- dispatchAppLoaderState({
6148
- type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
6149
- });
6150
6153
  }
6151
- catch (e) {
6152
- dispatchPostalState({
6153
- type: StoreFormHomePostalActionTypes.FormHomePostalValidate,
6154
- payload: { inValidation: false },
6155
- });
6156
- dispatchPostalState({
6157
- type: StoreFormHomePostalActionTypes.FormHomePostalValidateSet,
6158
- payload: { isValid: true },
6159
- });
6160
- formIsValid = true;
6161
- dispatchAppLoaderState({
6162
- type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
6163
- });
6154
+ else {
6155
+ try {
6156
+ isOPTACallInProgress = true;
6157
+ dispatchAppLoaderState({
6158
+ type: StoreConfigAppLoaderActionTypes.AppLoaderOpen,
6159
+ payload: {
6160
+ description: '',
6161
+ },
6162
+ });
6163
+ await getPlaceByAddress(streetAddress, city, postalCode, provinceCode);
6164
+ isOPTACallInProgress = false;
6165
+ dispatchPostalState({
6166
+ type: StoreFormHomePostalActionTypes.FormHomePostalValidate,
6167
+ payload: { inValidation: false },
6168
+ });
6169
+ dispatchPostalState({
6170
+ type: StoreFormHomePostalActionTypes.FormHomePostalValidateSet,
6171
+ payload: { isValid: true },
6172
+ });
6173
+ formIsValid = true;
6174
+ dispatchAppLoaderState({
6175
+ type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
6176
+ });
6177
+ }
6178
+ catch (e) {
6179
+ isOPTACallInProgress = false;
6180
+ dispatchPostalState({
6181
+ type: StoreFormHomePostalActionTypes.FormHomePostalValidate,
6182
+ payload: { inValidation: false },
6183
+ });
6184
+ dispatchPostalState({
6185
+ type: StoreFormHomePostalActionTypes.FormHomePostalValidateSet,
6186
+ payload: { isValid: true },
6187
+ });
6188
+ formIsValid = true;
6189
+ dispatchAppLoaderState({
6190
+ type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
6191
+ });
6192
+ }
6164
6193
  }
6165
6194
  }
6166
6195
  else {
@@ -6636,5 +6665,5 @@ const useValidationLifeApplicant = () => {
6636
6665
  };
6637
6666
  };
6638
6667
 
6639
- export { CarQuoteDataHandler, ClearFormDataHandler, 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, globalStateReducer, initHttpResponse, reducers, default_1 as token, 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 };
6668
+ 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, globalStateReducer, initHttpResponse, reducers, default_1 as token, 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 };
6640
6669
  //# sourceMappingURL=index.js.map