@mychoice/mychoice-sdk-store 2.0.0 → 2.0.2
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/README.md +2 -2
- package/dist/cjs/handlers/dataHandlers/PostalDataHandler/PostalDataHandler.d.ts +1 -1
- package/dist/cjs/handlers/dataHandlers/QuoteDataHandler/interfaces.d.ts +1 -0
- package/dist/cjs/handlers/dataHandlers/VehicleDataHandlers/interfaces.d.ts +1 -1
- package/dist/cjs/handlers/dataHandlers/shared/dataReducer/interfaces.d.ts +1 -1
- package/dist/cjs/index.js +42 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/httpRequest/interfaces.d.ts +1 -1
- package/dist/cjs/states/StoreProvider.d.ts +1 -1
- package/dist/cjs/states/reducers/states/ConfigState/AppConfigState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/ConfigState/AppDeviceState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/ConfigState/AppModalState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/DriverInfoState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/DriverLicenceState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/helper.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/QuoteState/actions.d.ts +2 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +8 -0
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/AddressState/interfaces.d.ts +2 -2
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/helper.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/localStore.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +1 -1
- package/dist/cjs/states/reducers/states/formStates/shared/helpers.d.ts +1 -1
- package/dist/esm/handlers/dataHandlers/PostalDataHandler/PostalDataHandler.d.ts +1 -1
- package/dist/esm/handlers/dataHandlers/QuoteDataHandler/interfaces.d.ts +1 -0
- package/dist/esm/handlers/dataHandlers/VehicleDataHandlers/interfaces.d.ts +1 -1
- package/dist/esm/handlers/dataHandlers/shared/dataReducer/interfaces.d.ts +1 -1
- package/dist/esm/index.js +42 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/httpRequest/interfaces.d.ts +1 -1
- package/dist/esm/states/StoreProvider.d.ts +1 -1
- package/dist/esm/states/reducers/states/ConfigState/AppConfigState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/ConfigState/AppDeviceState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/ConfigState/AppModalState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/DriverInfoState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/DriverLicenceState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/helper.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/QuoteState/actions.d.ts +2 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +8 -0
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormHomeState/AddressState/interfaces.d.ts +2 -2
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/helper.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/localStore.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +1 -1
- package/dist/esm/states/reducers/states/formStates/shared/helpers.d.ts +1 -1
- package/dist/index.d.ts +12 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosError, AxiosResponse, CancelToken, Method } from 'axios';
|
|
2
|
-
import { RequestTypes, HttpRequestHeaderTypes } from '@
|
|
2
|
+
import { RequestTypes, HttpRequestHeaderTypes } from '@mychoice/mychoice-sdk-components';
|
|
3
3
|
export type HTTPRequestParamsTypes = never | null;
|
|
4
4
|
export type DefaultResponseData = {
|
|
5
5
|
count: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SdkFC } from '@
|
|
1
|
+
import { SdkFC } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
export declare const StoreProvider: SdkFC;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppTypes, InsuranceTypes } from '@
|
|
1
|
+
import { AppTypes, InsuranceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreConfigAppConfigActionTypes } from './actions';
|
|
3
3
|
export interface AppConfigStateInterface {
|
|
4
4
|
isReady: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceTypes, ScreenBPTypes } from '@
|
|
1
|
+
import { DeviceTypes, ScreenBPTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreConfigAppDeviceActionTypes } from './actions';
|
|
3
3
|
export interface DeviceScreenInterface {
|
|
4
4
|
width: number;
|
package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DriverPriorityTypes, ValidationStatusTypes } from '@
|
|
1
|
+
import { DriverPriorityTypes, ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormCarDiscountActionTypes } from './actions';
|
|
3
3
|
import { StateBaseInterface } from '../../shared';
|
|
4
4
|
export interface DiscountQuoterInfoInterface {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OccupationTypes, GenderTypes } from '@
|
|
1
|
+
import { OccupationTypes, GenderTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormCarDriverInfoActionTypes } from './actions';
|
|
3
3
|
import { BirthDatePayloadType, FormCarDriverStateInterface } from '../interfaces';
|
|
4
4
|
export type FormCarDriverInfoStateActionType = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DriverLicenceTypes } from '@
|
|
1
|
+
import { DriverLicenceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormCarDriverLicenceActionTypes } from './actions';
|
|
3
3
|
import { FormCarDriverStateInterface, LicenceDatePayloadType } from '../interfaces';
|
|
4
4
|
import { FormCarConfigStateInterface } from '../../ConfigState';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTypes, SelectDateInterface } from '@
|
|
1
|
+
import { DateTypes, SelectDateInterface } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { BirthDatePayloadType, FormCarDriverStateInterface, LicenceAgePayloadType, LicenceDatePayloadType, LicenceTypePayloadType } from './interfaces';
|
|
3
3
|
export declare const setDriverProperty: (state: FormCarDriverStateInterface, name: string, value: boolean) => FormCarDriverStateInterface;
|
|
4
4
|
export declare const removeDriverItem: (state: FormCarDriverStateInterface, driverIndex: number) => FormCarDriverStateInterface;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DriverLicenceTypes, GenderTypes, OccupationTypes } from '@
|
|
1
|
+
import { DriverLicenceTypes, GenderTypes, OccupationTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StateBaseInterface, TabStateInterface } from '../../shared';
|
|
3
3
|
import { FormCarConfigStateInterface } from '../ConfigState';
|
|
4
4
|
export interface DriverLicenceInterface {
|
|
@@ -5,5 +5,6 @@ export declare enum StoreFormCarQuoteActionTypes {
|
|
|
5
5
|
FormCarQuotesSet = "FormCarQuotesSet",
|
|
6
6
|
FormCarQuoteGetLocal = "FormCarQuoteGetLocal",
|
|
7
7
|
FormCarQuoteClear = "FormCarQuoteClear",
|
|
8
|
-
UpdateCarCallMessage = "UpdateCarCallMessage"
|
|
8
|
+
UpdateCarCallMessage = "UpdateCarCallMessage",
|
|
9
|
+
FormCarQuoteConfirmStepSet = "FormCarQuoteConfirmStepSet"
|
|
9
10
|
}
|
|
@@ -21,12 +21,14 @@ export interface CarQuoteItemInterface {
|
|
|
21
21
|
id: number | null;
|
|
22
22
|
priceMonthly: string;
|
|
23
23
|
priceYearly: string;
|
|
24
|
+
confirmQuote?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface FormCarQuoteStateInterface {
|
|
26
27
|
items: CarQuoteItemInterface[];
|
|
27
28
|
isRequested: boolean;
|
|
28
29
|
requestDate: string;
|
|
29
30
|
showCallMessage: boolean;
|
|
31
|
+
quoteConfirm?: boolean;
|
|
30
32
|
}
|
|
31
33
|
export type FormCarQuoteStateActionType = {
|
|
32
34
|
type: StoreFormCarQuoteActionTypes.FormCarQuoteIsRequestedSet;
|
|
@@ -60,6 +62,12 @@ export type FormCarQuoteStateActionType = {
|
|
|
60
62
|
showCallMessage: boolean;
|
|
61
63
|
};
|
|
62
64
|
localIndex?: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet;
|
|
67
|
+
payload: {
|
|
68
|
+
quoteConfirm: boolean;
|
|
69
|
+
};
|
|
70
|
+
localIndex?: string;
|
|
63
71
|
};
|
|
64
72
|
export type FormCarQuoteStateReducerInterface = (state: FormCarQuoteStateInterface, action: FormCarQuoteStateActionType) => FormCarQuoteStateInterface;
|
|
65
73
|
export interface FormCarQuoteHookInterface {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VehicleConditionTypes } from '@
|
|
1
|
+
import { VehicleConditionTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { FormCarVehicleStateInterface } from './interfaces';
|
|
3
3
|
export declare const removeVehicleItem: (state: FormCarVehicleStateInterface, vehicleIndex: number) => FormCarVehicleStateInterface;
|
|
4
4
|
export declare const createVehicleItem: (state: FormCarVehicleStateInterface) => FormCarVehicleStateInterface;
|
package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VehicleConditionTypes } from '@
|
|
1
|
+
import { VehicleConditionTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormCarVehicleActionTypes } from './actions';
|
|
3
3
|
import { StateBaseInterface, TabStateInterface } from '../../shared';
|
|
4
4
|
export interface VehicleComprehensiveInterface {
|
package/dist/cjs/states/reducers/states/formStates/FormHomeState/AddressState/interfaces.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface FormHomeAddressStateInterface extends StateBaseInterface {
|
|
|
6
6
|
addressStreet: string;
|
|
7
7
|
unitApartmentNumber: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type FormHomeAddressStateActionType = {
|
|
10
10
|
type: StoreFormHomeAddressActionTypes.FormHomeAddressValidate;
|
|
11
11
|
payload: {
|
|
12
12
|
inValidation: boolean;
|
|
@@ -45,7 +45,7 @@ export declare type FormHomeAddressStateActionType = {
|
|
|
45
45
|
payload?: null;
|
|
46
46
|
localIndex?: string;
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type FormHomeAddressStateReducerInterface = (state: FormHomeAddressStateInterface, action: FormHomeAddressStateActionType) => FormHomeAddressStateInterface;
|
|
49
49
|
export interface FormHomeAddressHookInterface {
|
|
50
50
|
addressState: FormHomeAddressStateInterface;
|
|
51
51
|
dispatchAddressState: (props: FormHomeAddressStateActionType) => void;
|
package/dist/cjs/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationStatusTypes } from '@
|
|
1
|
+
import { ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormHomeDiscountActionTypes } from './actions';
|
|
3
3
|
import { StateBaseInterface } from '../../shared';
|
|
4
4
|
export interface QuoterInfoInterface {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsuranceTypes } from '@
|
|
1
|
+
import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { FormHomeDwellingStateInterface } from './interfaces';
|
|
3
3
|
export declare const setHomeCoverageProperty: (state: FormHomeDwellingStateInterface, name: string, value: number | boolean | string) => FormHomeDwellingStateInterface;
|
|
4
4
|
export declare const getDwellingInitialState: (type: InsuranceTypes) => FormHomeDwellingStateInterface;
|
package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsuranceTypes } from '@
|
|
1
|
+
import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormHomeDwellingActionTypes } from './actions';
|
|
3
3
|
import { StateBaseInterface } from '../../shared';
|
|
4
4
|
export interface DwellingHeatingItemInterface {
|
package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/localStore.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsuranceTypes } from '@
|
|
1
|
+
import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { FormHomeDwellingStateInterface } from './interfaces';
|
|
3
3
|
export declare const getInsuranceType: () => InsuranceTypes.Car | InsuranceTypes.Home | InsuranceTypes.Condo | InsuranceTypes.Tenant;
|
|
4
4
|
export declare const getLocalDwellings: (localIndex?: string | undefined) => FormHomeDwellingStateInterface;
|
package/dist/cjs/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenderTypes, ValidationStatusTypes } from '@
|
|
1
|
+
import { GenderTypes, ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StoreFormLifeApplicantActionTypes } from './actions';
|
|
3
3
|
import { StateBaseInterface } from '../../shared';
|
|
4
4
|
export interface FormLifeApplicantStateInterface extends StateBaseInterface {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SelectDateInterface } from '@
|
|
1
|
+
import { SelectDateInterface } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { StateBaseInterface } from './interfaces';
|
|
3
3
|
export declare function setStateProperty<T extends StateBaseInterface>(state: T, key: string, value: string | number | boolean | SelectDateInterface | object, objectKey?: string | null): T;
|
|
4
4
|
export declare function setListItemProperty<T extends StateBaseInterface>(state: T, listKey: string, itemIndex: number, itemKey: string, value: string | number | boolean): T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { InsuranceTypes } from '@
|
|
1
|
+
import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { UseHandlerPostalInterface } from './interfaces';
|
|
3
3
|
export declare const useHandlerPostal: (insuranceType: InsuranceTypes) => UseHandlerPostalInterface;
|
|
@@ -2,4 +2,5 @@ import { DataHandlerRequestState } from '../shared';
|
|
|
2
2
|
export type UseHandlerQuoteInterface = DataHandlerRequestState & {
|
|
3
3
|
postRequestQuoteOnliaUrl: (isLoader: boolean, redirectUrl: string) => void;
|
|
4
4
|
postRequestQuote: (isRecalc: boolean) => void;
|
|
5
|
+
postPerformLeadsAction?: () => void;
|
|
5
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SelectOptionInterface } from '@
|
|
1
|
+
import { SelectOptionInterface } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { DataHandlerRequestState } from '../shared';
|
|
3
3
|
export type UseHandlerVehicleMakeInterface = DataHandlerRequestState & {
|
|
4
4
|
getVehicleMake: (year: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestStatusTypes } from '@
|
|
1
|
+
import { RequestStatusTypes } from '@mychoice/mychoice-sdk-components';
|
|
2
2
|
import { DataHandlerActionTypes } from './actions';
|
|
3
3
|
export type DataHandlerRequestState = {
|
|
4
4
|
status: RequestStatusTypes;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { defaultLocalIndex, HttpRequestHeaderTypes, RequestTypes, ModalTypes, DeviceTypes, ScreenBPTypes, DeviceTypeWidthList, ScreenBPList, AppTypes, InsuranceTypes, VehicleConditionTypes, VehiclePrimaryUseTypes, deepClone, CoverageTypes, getFormattedDate, GenderTypes, OccupationTypes, addDaysToDate, compareDates, DriverLicenceTypes, DateTypes, getLicenceMinDate, addYearsToDate, subMonthsFromDate, getDifferenceInYears, DriverListTypes, addMonthsToDate, ValidationStatusTypes, DriverPriorityTypes, defaultBrokerPhone, subYearsFromDate, ApplicantListTypes, useEffectOnce, getInsuranceType as getInsuranceType$2, API_AUTH, RequestStatusTypes, PROFILE_API, getDaysOfMonth, getDifferenceInHours, MAX_LOCAL_STORAGE_HOURS_THEBIG, MAX_LOCAL_STORAGE_HOURS, API_APP, API_FORM_CAR, supportedProvinceCodes, API_FORM_HOME, API_FORM_LIFE } from '@
|
|
2
|
+
import { defaultLocalIndex, HttpRequestHeaderTypes, RequestTypes, ModalTypes, DeviceTypes, ScreenBPTypes, DeviceTypeWidthList, ScreenBPList, AppTypes, InsuranceTypes, VehicleConditionTypes, VehiclePrimaryUseTypes, deepClone, CoverageTypes, getFormattedDate, GenderTypes, OccupationTypes, addDaysToDate, compareDates, DriverLicenceTypes, DateTypes, getLicenceMinDate, addYearsToDate, subMonthsFromDate, getDifferenceInYears, DriverListTypes, addMonthsToDate, ValidationStatusTypes, DriverPriorityTypes, defaultBrokerPhone, subYearsFromDate, ApplicantListTypes, useEffectOnce, getInsuranceType as getInsuranceType$2, API_AUTH, RequestStatusTypes, PROFILE_API, getDaysOfMonth, getDifferenceInHours, MAX_LOCAL_STORAGE_HOURS_THEBIG, MAX_LOCAL_STORAGE_HOURS, API_APP, API_FORM_CAR, supportedProvinceCodes, API_FORM_HOME, API_FORM_LIFE } from '@mychoice/mychoice-sdk-components';
|
|
3
3
|
import { useMemo, useReducer, useState } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Provider, useSelector, useDispatch } from 'react-redux';
|
|
@@ -2013,6 +2013,7 @@ var StoreFormCarQuoteActionTypes;
|
|
|
2013
2013
|
StoreFormCarQuoteActionTypes["FormCarQuoteGetLocal"] = "FormCarQuoteGetLocal";
|
|
2014
2014
|
StoreFormCarQuoteActionTypes["FormCarQuoteClear"] = "FormCarQuoteClear";
|
|
2015
2015
|
StoreFormCarQuoteActionTypes["UpdateCarCallMessage"] = "UpdateCarCallMessage";
|
|
2016
|
+
StoreFormCarQuoteActionTypes["FormCarQuoteConfirmStepSet"] = "FormCarQuoteConfirmStepSet";
|
|
2016
2017
|
})(StoreFormCarQuoteActionTypes || (StoreFormCarQuoteActionTypes = {}));
|
|
2017
2018
|
|
|
2018
2019
|
const setQuoteStateProperty$2 = (state, name, value) => {
|
|
@@ -2039,6 +2040,8 @@ const formCarQuoteStateReducer = (state = { ...formCarQuoteInitialState }, actio
|
|
|
2039
2040
|
return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'items', action.payload.items));
|
|
2040
2041
|
case StoreFormCarQuoteActionTypes.FormCarQuoteRequestDateSet:
|
|
2041
2042
|
return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'requestDate', action.payload.requestDate));
|
|
2043
|
+
case StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet:
|
|
2044
|
+
return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'quoteConfirm', action.payload.quoteConfirm));
|
|
2042
2045
|
case StoreFormCarQuoteActionTypes.FormCarQuoteGetLocal:
|
|
2043
2046
|
return {
|
|
2044
2047
|
...getLocalQuotes$2(action.localIndex),
|
|
@@ -5195,6 +5198,12 @@ const CarQuoteDataHandler = () => {
|
|
|
5195
5198
|
type: StoreFormCarQuoteActionTypes.FormCarQuotesSet,
|
|
5196
5199
|
payload: { items: response.data },
|
|
5197
5200
|
});
|
|
5201
|
+
if (discountState.quoterInfo.initial) {
|
|
5202
|
+
dispatchQuoteState({
|
|
5203
|
+
type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet,
|
|
5204
|
+
payload: { quoteConfirm: !!response.data?.[0]?.confirmQuote },
|
|
5205
|
+
});
|
|
5206
|
+
}
|
|
5198
5207
|
setRequestState({
|
|
5199
5208
|
type: DataHandlerActionTypes.SetSuccess,
|
|
5200
5209
|
});
|
|
@@ -5213,6 +5222,37 @@ const CarQuoteDataHandler = () => {
|
|
|
5213
5222
|
}
|
|
5214
5223
|
}
|
|
5215
5224
|
};
|
|
5225
|
+
const postPerformLeadsAction = async () => {
|
|
5226
|
+
const { firstName, lastName, phone } = discountState.quoterInfo;
|
|
5227
|
+
const requestBody = {
|
|
5228
|
+
quote_id: quoteState.items[0].id,
|
|
5229
|
+
first_name: firstName,
|
|
5230
|
+
last_name: lastName,
|
|
5231
|
+
phone,
|
|
5232
|
+
};
|
|
5233
|
+
openLoader('Please wait while we are finalizing your quote.');
|
|
5234
|
+
try {
|
|
5235
|
+
await httpRequest({
|
|
5236
|
+
url: API_FORM_CAR.POST_SEND_LEADS,
|
|
5237
|
+
method: RequestTypes.Post,
|
|
5238
|
+
data: requestBody,
|
|
5239
|
+
withoutToken: true,
|
|
5240
|
+
cancelToken,
|
|
5241
|
+
});
|
|
5242
|
+
}
|
|
5243
|
+
catch (error) {
|
|
5244
|
+
setRequestState({
|
|
5245
|
+
type: DataHandlerActionTypes.SetError,
|
|
5246
|
+
payload: 'Axios request error',
|
|
5247
|
+
});
|
|
5248
|
+
}
|
|
5249
|
+
// As precaution always reveal all quotes even if lead endpoint failed
|
|
5250
|
+
dispatchQuoteState({
|
|
5251
|
+
type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet,
|
|
5252
|
+
payload: { quoteConfirm: false },
|
|
5253
|
+
});
|
|
5254
|
+
dispatchAppLoaderState({ type: StoreConfigAppLoaderActionTypes.AppLoaderClose });
|
|
5255
|
+
};
|
|
5216
5256
|
return ({
|
|
5217
5257
|
status,
|
|
5218
5258
|
successMessage,
|
|
@@ -5222,6 +5262,7 @@ const CarQuoteDataHandler = () => {
|
|
|
5222
5262
|
responseError,
|
|
5223
5263
|
postRequestQuoteOnliaUrl,
|
|
5224
5264
|
postRequestQuote,
|
|
5265
|
+
postPerformLeadsAction,
|
|
5225
5266
|
});
|
|
5226
5267
|
};
|
|
5227
5268
|
|