Merge branch 'develop' into rlsmerge/2025.01.30-to-develop
This commit is contained in:
commit
2ccdb423b3
10 changed files with 116 additions and 12 deletions
|
|
@ -168,6 +168,10 @@ const endpoints = {
|
||||||
url: "/analytics/api/v1/analytics/initialize",
|
url: "/analytics/api/v1/analytics/initialize",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
|
LogPartQuestions: {
|
||||||
|
url: "/analytics/api/v1/analytics/log-part-questions",
|
||||||
|
method: "POST",
|
||||||
|
},
|
||||||
GetExperimentsByUser: {
|
GetExperimentsByUser: {
|
||||||
url: "/analytics/api/v1/analytics/get-experiments",
|
url: "/analytics/api/v1/analytics/get-experiments",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
const experimentUniverses = {
|
const experimentUniverses = {
|
||||||
CONCEPT_FUNNEL: "ConceptFunnel",
|
CONCEPT_FUNNEL: "ConceptFunnel",
|
||||||
RECAL_PRICE_REMOVAL: "NextGen_RecalPriceRemoval",
|
RECAL_PRICE_REMOVAL: "NextGen_RecalPriceRemoval",
|
||||||
|
MSR: "MSR",
|
||||||
};
|
};
|
||||||
|
|
||||||
const experimentSettings = {
|
const experimentSettings = {
|
||||||
|
|
@ -16,6 +17,7 @@ const experimentSettings = {
|
||||||
RECAL_PRICE_REMOVE: "RecalPriceRemove",
|
RECAL_PRICE_REMOVE: "RecalPriceRemove",
|
||||||
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL: "NextGen_InternalInsuranceTabDisplayThreshold",
|
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL: "NextGen_InternalInsuranceTabDisplayThreshold",
|
||||||
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL: "NextGen_ExternalInsuranceTabDisplayThreshold",
|
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL: "NextGen_ExternalInsuranceTabDisplayThreshold",
|
||||||
|
DISPLAY_MSR: "DisplayMSR",
|
||||||
};
|
};
|
||||||
|
|
||||||
const experimentTriggers = {
|
const experimentTriggers = {
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,5 @@ export const headerKeys = {
|
||||||
SESSION_SEQUENCE_NUMBER: "X-Session-Sequence-Number",
|
SESSION_SEQUENCE_NUMBER: "X-Session-Sequence-Number",
|
||||||
TRANSACTION_ID: "X-Transaction-Id",
|
TRANSACTION_ID: "X-Transaction-Id",
|
||||||
EON: "X-Enterprise-Order-Number",
|
EON: "X-Enterprise-Order-Number",
|
||||||
|
LOG_ENABLED: "log-enabled"
|
||||||
};
|
};
|
||||||
|
|
|
||||||
7
src/constants/part-number-strings.js
Normal file
7
src/constants/part-number-strings.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
const partNumberStrings = {
|
||||||
|
// Recalibration
|
||||||
|
MOBILE_STATIC_RECAL_FEE: "RECAL MOBILE",
|
||||||
|
MOBILE_DUAL_RECAL_FEE: "RECAL MOBILEDUAL",
|
||||||
|
};
|
||||||
|
|
||||||
|
export { partNumberStrings };
|
||||||
|
|
@ -42,10 +42,6 @@ const storeActions = {
|
||||||
VALIDATE_ZIP: "validateZip",
|
VALIDATE_ZIP: "validateZip",
|
||||||
PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "priceOrderItemsAndSaveServerData",
|
PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "priceOrderItemsAndSaveServerData",
|
||||||
TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "taxOrderItemsAndSaveServerData",
|
TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "taxOrderItemsAndSaveServerData",
|
||||||
LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure",
|
|
||||||
LOG_PAGE_VIEW: "logPageView",
|
|
||||||
LOG_CUSTOM_EVENT: "logCustomEvent",
|
|
||||||
INITIALIZE_SESSION: "initializeSession",
|
|
||||||
GET_EXPERIMENTS_BY_USER: "GetExperimentsByUser",
|
GET_EXPERIMENTS_BY_USER: "GetExperimentsByUser",
|
||||||
RUN_EXPERIMENTS_FOR_TRIGGER: "runExperimentsForTrigger",
|
RUN_EXPERIMENTS_FOR_TRIGGER: "runExperimentsForTrigger",
|
||||||
CLEAR_VIN: "clearVin",
|
CLEAR_VIN: "clearVin",
|
||||||
|
|
@ -57,6 +53,13 @@ const storeActions = {
|
||||||
GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber",
|
GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber",
|
||||||
GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems",
|
GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems",
|
||||||
|
|
||||||
|
// Analytics
|
||||||
|
LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure",
|
||||||
|
LOG_PAGE_VIEW: "logPageView",
|
||||||
|
LOG_CUSTOM_EVENT: "logCustomEvent",
|
||||||
|
INITIALIZE_SESSION: "initializeSession",
|
||||||
|
LOG_PART_QUESTIONS: "logPartQuestions",
|
||||||
|
|
||||||
// DEPENDENCY MUTATIONS
|
// DEPENDENCY MUTATIONS
|
||||||
RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleStateAndDependencies",
|
RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleStateAndDependencies",
|
||||||
RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies",
|
RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies",
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ export default {
|
||||||
[headerKeys.REFERRAL_SEQUENCE_NUMBER]: order?.referralSequenceNumber,
|
[headerKeys.REFERRAL_SEQUENCE_NUMBER]: order?.referralSequenceNumber,
|
||||||
[headerKeys.TRANSACTION_ID]: crypto.randomUUID(),
|
[headerKeys.TRANSACTION_ID]: crypto.randomUUID(),
|
||||||
[headerKeys.EON]: order?.eon,
|
[headerKeys.EON]: order?.eon,
|
||||||
|
[headerKeys.LOG_ENABLED]: store.getters.applicationUser?.loggingOption ?? false,
|
||||||
};
|
};
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,43 @@ export default {
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const hasRecalPriceRemoveExperiment = await store.getters.shouldHideRecalibration;
|
const hasRecalPriceRemoveExperiment = await store.getters.shouldHideRecalibration;
|
||||||
|
|
||||||
|
// send part question data to SPS API for logging
|
||||||
|
const orderFromStore = await deepClone(store.getters.order);
|
||||||
|
const applicationUserFromStore = await deepClone(store.getters.applicationUser);
|
||||||
|
const ctu = orderFromStore.workOrderNumber?.split("-")[0];
|
||||||
|
const partsOrQuestions = applicationUserFromStore.pageData["part-questions"].partsOrQuestions;
|
||||||
|
const onlyPartsWithQuestions = partsOrQuestions.filter((part) => {
|
||||||
|
return part.partQuestions?.length > 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
onlyPartsWithQuestions.forEach(part => {
|
||||||
|
const payloadPartQuestions = [];
|
||||||
|
part.partQuestions.forEach(question => {
|
||||||
|
payloadPartQuestions.push({
|
||||||
|
questionSeq: question.questionSequence,
|
||||||
|
questionText: question.questionText,
|
||||||
|
answerText: question.answerSelected.split("|")[3],
|
||||||
|
basePart: question.answerSelected.split("|")[2],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const payload = {
|
||||||
|
eon: orderFromStore.eon,
|
||||||
|
ctu: ctu,
|
||||||
|
workOrderId: orderFromStore.workOrderId,
|
||||||
|
workOrderNumber: orderFromStore.workOrderNumber,
|
||||||
|
carId: orderFromStore.vehicle.carId,
|
||||||
|
glassLocation: part.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
|
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order
|
||||||
|
|
||||||
// Call APIs
|
// Call APIs
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { getMountOptions } from "@/helpers/unit-test-helper";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
|
|
||||||
// Define Mocks
|
// Define Mocks
|
||||||
jest.mock("@/helpers/cms-content-helper", () => ({
|
jest.mock("@/helpers/cms-content-helper", () => ({
|
||||||
|
|
@ -199,6 +200,9 @@ beforeEach(() => {
|
||||||
zipCode: "43054",
|
zipCode: "43054",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
experimentSettings: {
|
||||||
|
settingName: experimentSettings.DISPLAY_MSR,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,8 @@ import contentGroupModal from "@/fmg-components/content-group-modal/content-grou
|
||||||
|
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import experimentMixin from "@/mixins/experiment-mixin.js";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
|
|
@ -151,6 +153,7 @@ import {
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { applicationConfig } from "@/constants/application-config";
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
import { Provider } from "@/layouts/service-location/classes/provider";
|
import { Provider } from "@/layouts/service-location/classes/provider";
|
||||||
|
import { partNumberStrings } from "@/constants/part-number-strings";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
|
|
@ -159,7 +162,6 @@ import { defineRule } from "vee-validate";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
|
|
||||||
const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
|
const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
|
||||||
const MOBILE_STATIC_RECAL_FEE_PART_NUMBER = "RECAL MOBILE";
|
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("mobile-location-required", (value) => {
|
defineRule("mobile-location-required", (value) => {
|
||||||
|
|
@ -319,11 +321,19 @@ export default {
|
||||||
},
|
},
|
||||||
isMobileStaticRecalibrationApplicable() {
|
isMobileStaticRecalibrationApplicable() {
|
||||||
return (
|
return (
|
||||||
|
this.displayMSR &&
|
||||||
this.isVehicleMobileStaticRecalibrationApplicable &&
|
this.isVehicleMobileStaticRecalibrationApplicable &&
|
||||||
this.mobileFeePart?.partNumber == MOBILE_STATIC_RECAL_FEE_PART_NUMBER &&
|
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
||||||
(this.isInsurance ? this.mobileFeePart?.isInsurable : true)
|
(this.isInsurance ? this.mobileFeePart?.isInsurable : true)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
displayMSR() {
|
||||||
|
return (
|
||||||
|
experimentMixin.methods
|
||||||
|
.getSettingValue(experimentSettings.DISPLAY_MSR)
|
||||||
|
?.toLowerCase() === "true"
|
||||||
|
);
|
||||||
|
},
|
||||||
mobileFeeApplies() {
|
mobileFeeApplies() {
|
||||||
if (
|
if (
|
||||||
this.mobileFeePart?.laborAmount > 0 ||
|
this.mobileFeePart?.laborAmount > 0 ||
|
||||||
|
|
|
||||||
|
|
@ -1445,6 +1445,39 @@ export const actions = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
logPartQuestions(
|
||||||
|
context,
|
||||||
|
{
|
||||||
|
eon,
|
||||||
|
ctu,
|
||||||
|
workOrderId,
|
||||||
|
workOrderNumber,
|
||||||
|
carId,
|
||||||
|
glassLocation,
|
||||||
|
partQuestions,
|
||||||
|
userAgent,
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
var payload = {
|
||||||
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
|
eon: eon,
|
||||||
|
ctu: ctu,
|
||||||
|
workOrderId: workOrderId,
|
||||||
|
workOrderNumber: workOrderNumber,
|
||||||
|
carId: carId,
|
||||||
|
glassLocation: glassLocation,
|
||||||
|
partQuestions: partQuestions,
|
||||||
|
userAgent: navigator.userAgent
|
||||||
|
};
|
||||||
|
|
||||||
|
return globalMethods
|
||||||
|
.callHttpClient({
|
||||||
|
method: endpoints.LogPartQuestions.method,
|
||||||
|
endpoint: endpoints.LogPartQuestions.url,
|
||||||
|
payload: payload,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// Misc Actions
|
// Misc Actions
|
||||||
setReferralInformation(context, { referralNumber, referralDate, referralCorrelationId, eon }) {
|
setReferralInformation(context, { referralNumber, referralDate, referralCorrelationId, eon }) {
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
||||||
|
|
@ -1638,10 +1671,10 @@ export const actions = {
|
||||||
var endPoint = `${endpoints.GetMobileFeePart.url}/?serviceType=${serviceType}&facilityType=${facilityType}&parentAccountNumber=${parentAccountNumber}&billToAccountNumber=${billToAccountNumber}&providerNumber=${providerNumber}&isItacOptimized=${isItacOptimized}&zipCode=${zipCode}`;
|
var endPoint = `${endpoints.GetMobileFeePart.url}/?serviceType=${serviceType}&facilityType=${facilityType}&parentAccountNumber=${parentAccountNumber}&billToAccountNumber=${billToAccountNumber}&providerNumber=${providerNumber}&isItacOptimized=${isItacOptimized}&zipCode=${zipCode}`;
|
||||||
|
|
||||||
if (isMobileStaticRecalibrationApplicable) {
|
if (isMobileStaticRecalibrationApplicable) {
|
||||||
const staticRecalPartNumber = getStaticRecalPartNumber(order.lineItems?.glassParts[0]);
|
const recalPartNumber = getRecalPartNumber(order.lineItems?.glassParts[0]);
|
||||||
const carId = order.vehicle?.carId;
|
const carId = order.vehicle?.carId;
|
||||||
if (staticRecalPartNumber && carId) {
|
if (recalPartNumber && carId) {
|
||||||
endPoint = `${endPoint}&partNumbers=${staticRecalPartNumber}&carId=${carId}`;
|
endPoint = `${endPoint}&partNumbers=${recalPartNumber}&carId=${carId}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3685,9 +3718,11 @@ function saveExternalParameterState(externalParameterState) {
|
||||||
window.sessionStorage.setItem("externalParameterState", JSON.stringify(externalParameterState));
|
window.sessionStorage.setItem("externalParameterState", JSON.stringify(externalParameterState));
|
||||||
}
|
}
|
||||||
|
|
||||||
//This function checks if static recalibration is available for the vehicle and returns the part number for it.
|
//This function finds the recalibration part and returns the part number for it.
|
||||||
function getStaticRecalPartNumber(glassPartsArray) {
|
function getRecalPartNumber(glassPartsArray) {
|
||||||
const recalPart = glassPartsArray.childParts.find((item) => item.partNumber === "RECAL STATIC");
|
const recalPart = glassPartsArray.childParts.find(
|
||||||
|
(item) => item.partType === partTypeStrings.ADAS_RECALIBRATION
|
||||||
|
);
|
||||||
if (recalPart) {
|
if (recalPart) {
|
||||||
return recalPart.partNumber;
|
return recalPart.partNumber;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue