CASH-97
CASH-97 got phone number from leadGen and populated customer-details phone number field
This commit is contained in:
parent
ae178c811a
commit
969ea18d2a
9 changed files with 52 additions and 40 deletions
|
|
@ -5,5 +5,5 @@ export const headerKeys = {
|
|||
SESSION_SEQUENCE_NUMBER: "X-Session-Sequence-Number",
|
||||
TRANSACTION_ID: "X-Transaction-Id",
|
||||
EON: "X-Enterprise-Order-Number",
|
||||
LOG_ENABLED: "log-enabled"
|
||||
LOG_ENABLED: "log-enabled",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ const queryStrings = {
|
|||
ORGANIC_SOCIAL: "organic_social",
|
||||
EXPERIMENTS: "experiments",
|
||||
FROM_HERITAGE: "fromheritage",
|
||||
PHONE_NUMBER: "phonenumber",
|
||||
};
|
||||
|
||||
export { queryStrings };
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ const storeMutations = {
|
|||
UPDATE_EXTERNAL_PARAMETER_VIN_SELECTION: "updateExternalParameterVinSelection",
|
||||
UPDATE_EXTERNAL_PARAMETER_SERVICE_PACKAGE: "updateExternalParameterServicePackage",
|
||||
UPDATE_EXTERNAL_PARAMETER_SOURCE: "updateExternalParameterSource",
|
||||
UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER: "updateExternalParameterPhoneNumber",
|
||||
|
||||
//RESET EXTERNAL_PARAMETER MUTATIONS
|
||||
RESET_EXTERNAL_PARAMETER_VEHICLE_STATE: "resetExternalParameterVehicleState",
|
||||
|
|
@ -115,6 +116,7 @@ const storeMutations = {
|
|||
RESET_EXTERNAL_PARAMETER_SERVICEZIP_STATE: "resetExternalParameterServiceZipState",
|
||||
RESET_EXTERNAL_PARAMETER_QUOTE_STATE: "resetExternalParameterQuoteState",
|
||||
RESET_EXTERNAL_PARAMETER_SOURCE_STATE: "resetExternalParameterSourceState",
|
||||
RESET_EXTERNAL_PARAMETER_CUSTOMER_STATE: "resetExternalParameterCustomerState",
|
||||
RESET_IS_EXTERNAL_PARAMETER: "resetIsExternalParameter",
|
||||
|
||||
//Affiliate Cookies
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.alert {
|
||||
border-radius: $border-radius-lg;
|
||||
border: 1px solid $green;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ export default {
|
|||
.textbox-question {
|
||||
padding: 0;
|
||||
margin: 0 0 1.5rem 0;
|
||||
|
||||
|
||||
label {
|
||||
text-align: left;
|
||||
font-weight: 900;
|
||||
|
|
@ -258,7 +258,7 @@ export default {
|
|||
|
||||
&.progress-saved {
|
||||
.modal-footer-button,
|
||||
.modal-disclaimer {
|
||||
.modal-disclaimer {
|
||||
display: none;
|
||||
}
|
||||
.skip-button {
|
||||
|
|
|
|||
|
|
@ -116,13 +116,13 @@ export default {
|
|||
|
||||
// send part question data to SPS API for logging
|
||||
const orderFromStore = await deepClone(store.getters.order);
|
||||
const ctu = orderFromStore.serviceLocation?.zipCodeCtu
|
||||
const ctu = orderFromStore.serviceLocation?.zipCodeCtu;
|
||||
|
||||
const partsOrQuestions = orderFromStore.damage?.partQuestionAnswers;
|
||||
|
||||
partsOrQuestions.forEach(pqa => {
|
||||
partsOrQuestions.forEach((pqa) => {
|
||||
const payloadPartQuestions = [];
|
||||
pqa.answeredQuestions.forEach(answer => {
|
||||
pqa.answeredQuestions.forEach((answer) => {
|
||||
payloadPartQuestions.push({
|
||||
questionSeq: answer?.questionNum,
|
||||
questionText: answer?.questionText,
|
||||
|
|
@ -132,24 +132,18 @@ export default {
|
|||
});
|
||||
|
||||
const payload = {
|
||||
eon: orderFromStore.eon,
|
||||
ctu: ctu,
|
||||
workOrderId: orderFromStore.workOrderId,
|
||||
workOrderNumber: orderFromStore.workOrderNumber,
|
||||
carId: orderFromStore.vehicle.carId,
|
||||
glassLocation: pqa?.glassLocation,
|
||||
partQuestions: payloadPartQuestions,
|
||||
};
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.LOG_PART_QUESTIONS,
|
||||
payload,
|
||||
false
|
||||
);
|
||||
eon: orderFromStore.eon,
|
||||
ctu: ctu,
|
||||
workOrderId: orderFromStore.workOrderId,
|
||||
workOrderNumber: orderFromStore.workOrderNumber,
|
||||
carId: orderFromStore.vehicle.carId,
|
||||
glassLocation: pqa?.glassLocation,
|
||||
partQuestions: payloadPartQuestions,
|
||||
};
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.LOG_PART_QUESTIONS, payload, false);
|
||||
});
|
||||
|
||||
|
||||
// Create order
|
||||
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ import vehicleQuestion from "@/layouts/vehicle/vehicle-question/vehicle-question
|
|||
// Supporting files
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
import { experimentUniverses } from "@/constants/experiments";
|
||||
import { getSessionKeyValue, getUserIdValue, getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||
import {
|
||||
getSessionKeyValue,
|
||||
getUserIdValue,
|
||||
getDeviceIdValue,
|
||||
} from "@/helpers/heritage-integration/cookie-helper";
|
||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import { Form, defineRule } from "vee-validate";
|
||||
import { required } from "@/helpers/validation-rules";
|
||||
|
|
|
|||
|
|
@ -837,6 +837,7 @@ function updateExternalParameterState() {
|
|||
const externalParameterServicePackage = getQuerystringParameter(queryStrings.SERVICE_PACKAGE);
|
||||
const externalParameterNumberOfChips = getQuerystringParameter(queryStrings.NUMBER_OF_CHIPS);
|
||||
const externalParameterSource = getQuerystringParameter(queryStrings.EXPERIMENTS);
|
||||
const externalParameterPhoneNumber = getQuerystringParameter(queryStrings.PHONE_NUMBER);
|
||||
if (
|
||||
externalParameterYear &&
|
||||
externalParameterMake &&
|
||||
|
|
@ -892,6 +893,12 @@ function updateExternalParameterState() {
|
|||
if (externalParameterSource) {
|
||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_SOURCE, externalParameterSource);
|
||||
}
|
||||
if (externalParameterPhoneNumber) {
|
||||
store.commit(
|
||||
storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER,
|
||||
externalParameterPhoneNumber
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// if there is an existing external parameter state then they have already been through from an external source(LeadGen) and
|
||||
|
|
|
|||
|
|
@ -495,6 +495,11 @@ export const mutations = {
|
|||
externalParameterState.quote.servicePackage = servicePackage;
|
||||
saveExternalParameterState(externalParameterState);
|
||||
},
|
||||
updateExternalParameterPhoneNumber(state, phoneNumber) {
|
||||
externalParameterState.customer.phoneNumber = phoneNumber;
|
||||
state.order.customer.phoneNumber = externalParameterState.customer.phoneNumber;
|
||||
saveExternalParameterState(externalParameterState);
|
||||
},
|
||||
//RESET ExternalParameter MUTATIONS
|
||||
resetExternalParameterVehicleState(state) {
|
||||
externalParameterState.vehicle.year = null;
|
||||
|
|
@ -528,6 +533,10 @@ export const mutations = {
|
|||
externalParameterState.isExternalParameter = externalParameterStatus.INACTIVE;
|
||||
saveExternalParameterState(externalParameterState);
|
||||
},
|
||||
resetExternalParameterCustomerState(state) {
|
||||
externalParameterState.customer.phoneNumber = null;
|
||||
saveExternalParameterState(externalParameterState);
|
||||
},
|
||||
|
||||
// RESET DEPENDENCY MUTATIONS
|
||||
resetVehicleState(state) {
|
||||
|
|
@ -984,6 +993,7 @@ export const getters = {
|
|||
externalParameterQuote: (state) => externalParameterState?.quote,
|
||||
externalParameterServiceZip: (state) => externalParameterState?.serviceZip,
|
||||
externalParameterEstimate: (state) => externalParameterState?.estimate,
|
||||
externalParameterCustomer: (state) => externalParameterState?.customer,
|
||||
isExternalParameter: (state) => externalParameterState?.isExternalParameter,
|
||||
};
|
||||
|
||||
|
|
@ -1448,16 +1458,7 @@ export const actions = {
|
|||
|
||||
logPartQuestions(
|
||||
context,
|
||||
{
|
||||
eon,
|
||||
ctu,
|
||||
workOrderId,
|
||||
workOrderNumber,
|
||||
carId,
|
||||
glassLocation,
|
||||
partQuestions,
|
||||
userAgent,
|
||||
}
|
||||
{ eon, ctu, workOrderId, workOrderNumber, carId, glassLocation, partQuestions, userAgent }
|
||||
) {
|
||||
var payload = {
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
|
|
@ -1468,15 +1469,14 @@ export const actions = {
|
|||
carId: carId,
|
||||
glassLocation: glassLocation,
|
||||
partQuestions: partQuestions,
|
||||
userAgent: navigator.userAgent
|
||||
userAgent: navigator.userAgent,
|
||||
};
|
||||
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.LogPartQuestions.method,
|
||||
endpoint: endpoints.LogPartQuestions.url,
|
||||
payload: payload,
|
||||
});
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogPartQuestions.method,
|
||||
endpoint: endpoints.LogPartQuestions.url,
|
||||
payload: payload,
|
||||
});
|
||||
},
|
||||
|
||||
// Misc Actions
|
||||
|
|
@ -3132,6 +3132,7 @@ export const actions = {
|
|||
context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_ESTIMATE_STATE);
|
||||
context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_SERVICEZIP_STATE);
|
||||
context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_QUOTE_STATE);
|
||||
context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_CUSTOMER_STATE);
|
||||
context.commit(storeMutations.RESET_IS_EXTERNAL_PARAMETER);
|
||||
}
|
||||
},
|
||||
|
|
@ -3704,6 +3705,9 @@ function createExternalParameterDefaultState() {
|
|||
isInsurance: null,
|
||||
servicePackage: null,
|
||||
},
|
||||
customer: {
|
||||
phoneNumber: null,
|
||||
},
|
||||
};
|
||||
// set to session storage
|
||||
saveExternalParameterState(externalParameterDefaultState);
|
||||
|
|
|
|||
Loading…
Reference in a new issue