Merge branch 'develop' into feature/jnou/fix-iss-regression
This commit is contained in:
commit
7066163a95
11 changed files with 495 additions and 2 deletions
|
|
@ -272,6 +272,8 @@ stages:
|
|||
__VUE_APP_CUSTOMER_PORTAL_URL__: $(__VUE_APP_CUSTOMER_PORTAL_URL__)
|
||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||
__VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__)
|
||||
__VUE_APP_ADYEN_ENVIRONMENT__: $(__VUE_APP_ADYEN_ENVIRONMENT__)
|
||||
__VUE_APP_ADYEN_CLIENT_KEY__: $(__VUE_APP_ADYEN_CLIENT_KEY__)
|
||||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
|
|
@ -335,6 +337,8 @@ stages:
|
|||
__VUE_APP_CUSTOMER_PORTAL_URL__: $(__VUE_APP_CUSTOMER_PORTAL_URL__)
|
||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||
__VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__)
|
||||
__VUE_APP_ADYEN_ENVIRONMENT__: $(__VUE_APP_ADYEN_ENVIRONMENT__)
|
||||
__VUE_APP_ADYEN_CLIENT_KEY__: $(__VUE_APP_ADYEN_CLIENT_KEY__)
|
||||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
|
|
@ -398,6 +402,8 @@ stages:
|
|||
__VUE_APP_CUSTOMER_PORTAL_URL__: $(__VUE_APP_CUSTOMER_PORTAL_URL__)
|
||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||
__VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__)
|
||||
__VUE_APP_ADYEN_ENVIRONMENT__: $(__VUE_APP_ADYEN_ENVIRONMENT__)
|
||||
__VUE_APP_ADYEN_CLIENT_KEY__: $(__VUE_APP_ADYEN_CLIENT_KEY__)
|
||||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
|
|
@ -461,6 +467,8 @@ stages:
|
|||
__VUE_APP_CUSTOMER_PORTAL_URL__: $(__VUE_APP_CUSTOMER_PORTAL_URL__)
|
||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||
__VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__)
|
||||
__VUE_APP_ADYEN_ENVIRONMENT__: $(__VUE_APP_ADYEN_ENVIRONMENT__)
|
||||
__VUE_APP_ADYEN_CLIENT_KEY__: $(__VUE_APP_ADYEN_CLIENT_KEY__)
|
||||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -10475,7 +10475,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
"version": "3.3.3",
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
|
||||
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -182,6 +182,14 @@ const endpoints = Object.freeze({
|
|||
url: `${ANALYTICS_BASE_URL}/initialize`,
|
||||
method: 'POST'
|
||||
},
|
||||
LogDigitalConsumer: {
|
||||
url: `${ANALYTICS_BASE_URL}/digitalconsumer-log`,
|
||||
method: "POST",
|
||||
},
|
||||
LogIssSessionData: {
|
||||
url: `${ANALYTICS_BASE_URL}/digitalconsumer-session-logging`,
|
||||
method: "POST",
|
||||
},
|
||||
GetExperimentsByUser: {
|
||||
url: `${ANALYTICS_BASE_URL}/get-experiments`,
|
||||
method: 'GET'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import partTypeStrings from '@/constants/part-type-strings';
|
||||
import { deepClone } from '@/helpers/object-helper';
|
||||
|
||||
const recalPartTypes = [partTypeStrings.RECALIBRATION, partTypeStrings.ADAS_RECALIBRATION];
|
||||
|
||||
|
|
@ -23,3 +24,31 @@ export function getTopLevelGlassPartsWithRecal(glassParts) {
|
|||
|
||||
return glassParts.filter((gp) => isRecalPartOrHasChildRecalPart(gp));
|
||||
}
|
||||
|
||||
export function getItemsWithoutRecalParts(lineItemsArray) {
|
||||
if (!lineItemsArray || !Array.isArray(lineItemsArray)) return null;
|
||||
const firstLevelFiltered = deepClone(lineItemsArray).filter((li) => !isRecalPart(li));
|
||||
|
||||
const childrenFiltered = firstLevelFiltered.map((li) => {
|
||||
if (li.childParts && li.childParts.length > 0) {
|
||||
li.childParts = getItemsWithoutRecalParts(li.childParts);
|
||||
}
|
||||
|
||||
return li;
|
||||
});
|
||||
|
||||
return childrenFiltered;
|
||||
}
|
||||
|
||||
export function getRecalPartNumbers(glassPartsArray) {
|
||||
if (glassPartsArray && glassPartsArray.length > 0) {
|
||||
const topLevel = glassPartsArray.filter((gp) => isRecalPart(gp)).map((gp) => gp.partNumber);
|
||||
|
||||
const children = glassPartsArray.map((gp) => getRecalPartNumbers(gp.childParts)).flat();
|
||||
|
||||
return [...topLevel, ...children];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,3 +47,48 @@ export function getDateForSavedSessionTimeout() {
|
|||
currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS);
|
||||
return currentDate.toUTCString();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Function to return the iOS version of the device.
|
||||
*/
|
||||
|
||||
export function getiOSversion() {
|
||||
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
||||
// supports iOS 2.0 and later:
|
||||
var v = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);
|
||||
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function to return true/false if the user agent is a mobile device or not.
|
||||
*/
|
||||
|
||||
export function isMobileDevice() {
|
||||
const userAgent = navigator.userAgent;
|
||||
return (
|
||||
userAgent.includes("Android") ||
|
||||
userAgent.includes("Mobile") ||
|
||||
userAgent.includes("iPod") ||
|
||||
userAgent.includes("iPhone") ||
|
||||
userAgent.includes("IEMobile") ||
|
||||
userAgent.includes("BlackBerry") ||
|
||||
userAgent.includes("webOS")
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Function to return true/false if the user is using an apple browser on a device.
|
||||
*/
|
||||
|
||||
export function isAppleBrowser() {
|
||||
const userAgent = navigator.userAgent;
|
||||
return (
|
||||
userAgent.includes("iPod") ||
|
||||
userAgent.includes("iPad") ||
|
||||
userAgent.includes("iPhone") ||
|
||||
userAgent.includes("Mac")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
42
src/helpers/useragent-helper.js
Normal file
42
src/helpers/useragent-helper.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
Function to return the iOS version of the device.
|
||||
*/
|
||||
|
||||
export function getiOSversion() {
|
||||
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
||||
// supports iOS 2.0 and later:
|
||||
var v = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);
|
||||
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function to return true/false if the user agent is a mobile device or not.
|
||||
*/
|
||||
|
||||
export function isMobileDevice() {
|
||||
const userAgent = navigator.userAgent;
|
||||
return (
|
||||
userAgent.includes("Android") ||
|
||||
userAgent.includes("Mobile") ||
|
||||
userAgent.includes("iPod") ||
|
||||
userAgent.includes("iPhone") ||
|
||||
userAgent.includes("IEMobile") ||
|
||||
userAgent.includes("BlackBerry") ||
|
||||
userAgent.includes("webOS")
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Function to return true/false if the user is using an apple browser on a device.
|
||||
*/
|
||||
|
||||
export function isAppleBrowser() {
|
||||
const userAgent = navigator.userAgent;
|
||||
return (
|
||||
userAgent.includes("iPod") ||
|
||||
userAgent.includes("iPad") ||
|
||||
userAgent.includes("iPhone") ||
|
||||
userAgent.includes("Mac")
|
||||
);
|
||||
}
|
||||
|
|
@ -142,6 +142,10 @@ export default {
|
|||
availableLineItems.push(...feeItems);
|
||||
}
|
||||
|
||||
if (resultMap?.supportingItems?.length > 0) {
|
||||
availableLineItems.push(...resultMap.supportingItems);
|
||||
}
|
||||
|
||||
let hasBailedOut = false;
|
||||
const pricedItems = await store.getCombinedQuote(availableLineItems)
|
||||
.catch((err) => {
|
||||
|
|
@ -153,11 +157,13 @@ export default {
|
|||
next(`/?issPage=${issPageValues.BAILOUT_PAGE}`);
|
||||
});
|
||||
|
||||
const pricedVaps = pricedItems.filter((item) => !resultMap.supportingItems.some((si) => si.partNumber === item.partNumber));
|
||||
|
||||
// Call the "next" function to complete the transition to this page.
|
||||
if (!hasBailedOut) {
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.setData(pricedItems);
|
||||
vm.setData(pricedVaps);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@ import {
|
|||
GaEvents,
|
||||
ValueToLogTypes
|
||||
} from '@/constants/analytics';
|
||||
import { getCartTotal, getSubtotal } from '@/helpers/cart-helper';
|
||||
import { getRecalPartNumbers } from "@/helpers/recal-helper";
|
||||
import coverageStatuses from '@/constants/coverage-statuses';
|
||||
import coverageType from '@/constants/coverage-type';
|
||||
import issPageValues from '@/router/router-constants/issPage-values';
|
||||
import { useMainStore } from '@/store';
|
||||
|
||||
function pushToDataLayerIfDefined(data) {
|
||||
|
|
@ -161,6 +166,184 @@ export default {
|
|||
return baseMethod.apply(object, arguments);
|
||||
};
|
||||
},
|
||||
|
||||
logDigitalConsumer() {
|
||||
const store = useMainStore();
|
||||
const currentPageName = this.getPageNameByQueryString();
|
||||
const universes = store.applicationUser.experiments;
|
||||
const deviceId = getDeviceIdValue();
|
||||
const sid = getSessionIdValue();
|
||||
|
||||
const variationNames = universes
|
||||
.filter((item) => item.universeName === experimentSettings.CONCEPT_FUNNEL)
|
||||
.map((item) => item.variationName)
|
||||
.filter(Boolean); // removes undefined/null
|
||||
|
||||
const conceptVariation = variationNames.length > 0 ? variationNames[0] : "";
|
||||
|
||||
const isConceptExposed = universes.find(
|
||||
(item) => item.universeName === experimentSettings.CONCEPT_FUNNEL
|
||||
)?.isExposed;
|
||||
|
||||
const submittedOrder = store.getSubmittedOrder();
|
||||
const hasSubmittedOrder = store.hasSubmittedOrder();
|
||||
|
||||
// TODO: Find equivalent ISS methods for these:
|
||||
const hasSubmittedOrderAtConfirmationPage =
|
||||
hasSubmittedOrder && currentPageName?.toLowerCase() === issPageValues.ORDER_CONFIRMATION;
|
||||
|
||||
var payload = {
|
||||
deviceId: deviceId,
|
||||
sessionId: sid,
|
||||
actionName: `Browser page:${currentPageName}`,
|
||||
referralSequenceNumber: hasSubmittedOrderAtConfirmationPage
|
||||
? submittedOrder.referralSequenceNumber
|
||||
: store.order.referralSequenceNumber,
|
||||
referralNumber: hasSubmittedOrderAtConfirmationPage
|
||||
? submittedOrder.referralNumber
|
||||
: store.order.referralNumber,
|
||||
workOrderId: hasSubmittedOrderAtConfirmationPage
|
||||
? submittedOrder.workOrderId
|
||||
: store.order.workOrderId,
|
||||
workOrderNumber: hasSubmittedOrderAtConfirmationPage
|
||||
? submittedOrder.workOrderNumber
|
||||
: store.order.workOrderNumber,
|
||||
conceptVariation: conceptVariation,
|
||||
isConceptExposed: isConceptExposed,
|
||||
};
|
||||
|
||||
store.logDigitalConsumer(payload);
|
||||
},
|
||||
|
||||
// This sends session data to the session logging endpoint on the analytics service.
|
||||
// From there, it uses aws kinesis data stream, DigitalConsumer-Session-Data-Stream,
|
||||
// and aws FireHose stream, DigitalConsumer-Session-Firehose, to push data to an
|
||||
// S3 bucket, safelite-dev-digitalconsumer-session-data-us-east-2/1.
|
||||
// This bucket data is then picked up by snowflake for analytics use.
|
||||
pushIssSessionData() {
|
||||
const store = useMainStore();
|
||||
const submittedOrder = store.getSubmittedOrder();
|
||||
const hasSubmittedOrder = store.hasSubmittedOrder();
|
||||
const order = hasSubmittedOrder ? submittedOrder : store.order;
|
||||
const issConfig = store.issConfig;
|
||||
const applicationUser = store.applicationUser;
|
||||
|
||||
// NOTE: ISS does not support early bird times.
|
||||
const isEarlyBird = false; /*order?.lineItems?.supportingItems?.find(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD
|
||||
);
|
||||
*/
|
||||
|
||||
// NOTE: No promo codes on ISS at the moment.
|
||||
const promoCodes = ""; /*Array.isArray(order?.lineItems?.promos)
|
||||
? order?.lineItems?.promos
|
||||
.map((item) => item.promoCode)
|
||||
.filter((code) => code)
|
||||
.join(", ")
|
||||
: null;
|
||||
*/
|
||||
|
||||
const glassProducts = order?.damage?.glassToReplace?.map(
|
||||
(part) => `${part.glassLocation}-${part.glassName}`
|
||||
);
|
||||
|
||||
const format = (part) => `${part?.partNumber}-${part?.partType ? part.partType : ""}`;
|
||||
const mapParts = (arr) => (arr ?? []).map(format);
|
||||
|
||||
const glassParts = mapParts(order?.lineItems?.glassParts);
|
||||
const supportingItems = mapParts(order?.lineItems?.supportingItems);
|
||||
const vaps = mapParts(order?.lineItems?.vaps);
|
||||
const childParts = [].concat(
|
||||
...(order?.lineItems?.glassParts ?? []).map((gp) => mapParts(gp?.childParts))
|
||||
);
|
||||
const allParts = [...glassParts, ...supportingItems, ...vaps, ...childParts];
|
||||
|
||||
if (applicationUser?.pageData?.quote?.servicePackageSelected) {
|
||||
allParts.push(applicationUser.pageData.quote.servicePackageSelected);
|
||||
}
|
||||
|
||||
var appointment = `${order?.schedule?.date ?? ""} ${order?.schedule?.startTime ?? ""}`;
|
||||
var currentPageName = this.getPageNameByQueryString();
|
||||
/*
|
||||
// add query strings to the page name for debugging. on the vehicle page, if from an external link, pull it from the stash
|
||||
if (currentPageName === "vehicle") {
|
||||
if (!window.location.search) {
|
||||
if (store.getters.externalParameterState?.qsStash) {
|
||||
currentPageName += `${store.getters.externalParameterState.qsStash}`;
|
||||
}
|
||||
} else {
|
||||
currentPageName += `${window.location.search}`;
|
||||
}
|
||||
} else {
|
||||
if (window.location.search) {
|
||||
currentPageName += `${window.location.search}`;
|
||||
}
|
||||
}
|
||||
*/
|
||||
var parentAccountNumber = (order?.parentAccountNumber ?? ( issConfig.parentAccountNumber ?? 0)).toString();
|
||||
|
||||
var sessionData = {};
|
||||
sessionData.currentPage = currentPageName;
|
||||
sessionData.sid = getSessionIdValue();
|
||||
sessionData.deviceId = getDeviceIdValue();
|
||||
sessionData.issSessionId = applicationUser?.savedSessionId;
|
||||
sessionData.skey = getSessionKeyValue().toString();
|
||||
sessionData.userId = getUserIdValue();
|
||||
sessionData.carId = order?.vehicle?.carId;
|
||||
sessionData.vehicleYear = order?.vehicle?.year;
|
||||
sessionData.vehicleMake = order?.vehicle?.make;
|
||||
sessionData.vehicleModel = order?.vehicle?.model;
|
||||
sessionData.vehicleStyle = order?.vehicle?.style;
|
||||
sessionData.hasVin = order?.vehicle?.vin ? true : false;
|
||||
sessionData.cashOrInsuranceAccountType = "Insurance";
|
||||
sessionData.damageType = order?.damage?.isRepair ? "Repair" : "Replace";
|
||||
sessionData.productType = allParts;
|
||||
sessionData.eon = order?.eon;
|
||||
sessionData.referralNumber = order?.referralNumber;
|
||||
sessionData.referralSequenceNumber = order?.referralSequenceNumber;
|
||||
sessionData.referralDate = order?.referralDate;
|
||||
sessionData.workOrderNumber = order?.workOrderNumber;
|
||||
sessionData.workOrderId = order?.workOrderId;
|
||||
|
||||
sessionData.isPia = store.isPayInAdvance;
|
||||
sessionData.piaType = (store.isPayInAdvance ? order?.payment?.paymentMethod : null);
|
||||
|
||||
sessionData.parentAccountNumber = parentAccountNumber;
|
||||
sessionData.billToAccountNumber = issConfig.billToAccountNumber;
|
||||
sessionData.settledTenderAmount = order?.payment?.nextGenSettledAmount;
|
||||
sessionData.recalRequired = store.hasRecalibrationPart;
|
||||
sessionData.recalType = getRecalPartNumbers(order?.lineItems?.glassParts);
|
||||
|
||||
sessionData.serviceZipCode = order?.serviceLocation?.provider?.address?.zipCode
|
||||
? order?.serviceLocation?.provider?.address?.zipCode
|
||||
: order?.serviceLocation?.zipCode;
|
||||
sessionData.providerCtu = order?.serviceLocation?.provider?.address?.zipCodeCtu
|
||||
? order?.serviceLocation?.provider?.address?.zipCodeCtu
|
||||
: order?.serviceLocation?.zipCodeCtu;
|
||||
sessionData.appointmentDate = appointment;
|
||||
sessionData.serviceType = order?.serviceLocation?.appointmentType;
|
||||
sessionData.promoCodes = promoCodes;
|
||||
sessionData.hasTechnicianNotes = order?.contactInfo?.notesForTechnician ? true : false;
|
||||
sessionData.paymentMethod = order?.payment?.paymentMethod;
|
||||
sessionData.isTextingOptedIn = order?.contactInfo?.requestTextUpdates ? true : false;
|
||||
sessionData.isEarlyBird = isEarlyBird;
|
||||
|
||||
sessionData.insuranceCo = issConfig.clientName;
|
||||
sessionData.deductible = store.currentDeductible ?? 0;
|
||||
sessionData.isVerified = store.isVerified;
|
||||
sessionData.coverageStatus = coverageStatuses.mapToApi(order?.insuranceCoverage.coverageStatus);
|
||||
sessionData.coverageSubStatus = coverageType.mapToApi(order?.insuranceCoverage.coverageType);
|
||||
|
||||
sessionData.isNoComp = store.isNoComp;
|
||||
sessionData.isItac = store.isITAC;
|
||||
sessionData.subTotalPrice = getSubtotal(order).toString();
|
||||
sessionData.totalPrice = getCartTotal(order).toString();
|
||||
sessionData.cashPriceSubTotal = getSubtotal(order).toString();
|
||||
|
||||
sessionData.userAgent = navigator.userAgent;
|
||||
|
||||
store.logIssSessionData(sessionData);
|
||||
},
|
||||
|
||||
async initSession() {
|
||||
regenerateDeviceId();
|
||||
|
|
|
|||
|
|
@ -178,6 +178,12 @@ router.afterEach(async (to, from) => {
|
|||
if (to.query.issPage !== issPageValues.ENTRY_PAGE) {
|
||||
document.title = routerTitles[to.query.issPage] || 'Safelite Solutions®';
|
||||
|
||||
// digital consumer logging
|
||||
analyticsMixin.methods.logDigitalConsumer();
|
||||
|
||||
// digital consumer ISS session logging to snowflake
|
||||
analyticsMixin.methods.pushIssSessionData();
|
||||
|
||||
// Push page view to GA
|
||||
analyticsMixin.methods.pushPageViewToGA();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import {
|
|||
import { buildURLSearchParams, getPartNumbersListForQueryString } from '@/helpers/querystring-helper';
|
||||
import { getTopLevelGlassPartsWithRecal } from '@/helpers/recal-helper';
|
||||
import { getDateForSavedSessionTimeout } from '@/helpers/session-helper';
|
||||
import { isMobileDevice } from '@/helpers/useragent-helper';
|
||||
import issPageValues from '@/router/router-constants/issPage-values';
|
||||
import CoverageStatuses from '@/constants/coverage-statuses';
|
||||
|
||||
|
|
@ -1396,6 +1397,7 @@ export const useMainStore = defineStore({
|
|||
this.order.referralDate = response.referralDate;
|
||||
this.order.referralCorrelationId = response.referralCorrelationId;
|
||||
this.order.eon = response.eon;
|
||||
this.order.workOrderId = response.workOrderId;
|
||||
this.order.workOrderNumber = response.workOrderNumber;
|
||||
this.order.settledTenderAmount = response.settledTenderAmount;
|
||||
this.order.lockToken = response.lockToken;
|
||||
|
|
@ -2625,6 +2627,166 @@ export const useMainStore = defineStore({
|
|||
updateTriggeredSiteEntry(wasSiteEntryTriggered) {
|
||||
this.applicationUser.triggeredSiteEntry = wasSiteEntryTriggered;
|
||||
},
|
||||
|
||||
// TODO: Shouldn't this be async?
|
||||
logDigitalConsumer(
|
||||
{
|
||||
deviceId,
|
||||
sessionId,
|
||||
actionName,
|
||||
referralSequenceNumber,
|
||||
referralNumber,
|
||||
workOrderId,
|
||||
workOrderNumber,
|
||||
conceptVariation,
|
||||
isConceptExposed,
|
||||
}
|
||||
) {
|
||||
var payload = {
|
||||
sessionId: sessionId,
|
||||
deviceId: deviceId,
|
||||
actionName: actionName ?? "",
|
||||
referralSequenceNumber: referralSequenceNumber ?? "",
|
||||
referralNumber: referralNumber ?? "",
|
||||
applicationName: isMobileDevice() ? "ISS Mobile" : "ISS",
|
||||
workOrderId: workOrderId ?? "",
|
||||
workOrderNumber: workOrderNumber ?? "",
|
||||
conceptVariation: conceptVariation,
|
||||
isConceptExposed: isConceptExposed,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogDigitalConsumer.method,
|
||||
endpoint: endpoints.LogDigitalConsumer.url,
|
||||
payload,
|
||||
logApiCall: false,
|
||||
bailoutOnError: false
|
||||
}).then(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
console.log(`Analytics Service Error: ${error.data}`);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// TODO: Shouldn't this be async?
|
||||
logIssSessionData(
|
||||
{
|
||||
currentPage,
|
||||
sid,
|
||||
deviceId,
|
||||
issSessionId,
|
||||
skey,
|
||||
userId,
|
||||
carId,
|
||||
vehicleYear,
|
||||
vehicleMake,
|
||||
vehicleModel,
|
||||
vehicleStyle,
|
||||
hasVin,
|
||||
cashOrInsuranceAccountType,
|
||||
damageType,
|
||||
productType,
|
||||
eon,
|
||||
referralNumber,
|
||||
referralSequenceNumber,
|
||||
referralDate,
|
||||
workOrderNumber,
|
||||
workOrderId,
|
||||
isPia,
|
||||
piaType,
|
||||
parentAccountNumber,
|
||||
billToAccountNumber,
|
||||
settledTenderAmount,
|
||||
recalRequired,
|
||||
recalType,
|
||||
serviceZipCode,
|
||||
providerCtu,
|
||||
appointmentDate,
|
||||
serviceType,
|
||||
promoCodes,
|
||||
hasTechnicianNotes,
|
||||
paymentMethod,
|
||||
isTextingOptedIn,
|
||||
isEarlyBird,
|
||||
insuranceCo,
|
||||
deductible,
|
||||
isVerified,
|
||||
coverageStatus,
|
||||
coverageSubStatus,
|
||||
isNoComp,
|
||||
isItac,
|
||||
subTotalPrice,
|
||||
totalPrice,
|
||||
userAgent,
|
||||
cashPriceSubTotal,
|
||||
}
|
||||
) {
|
||||
var payload = {
|
||||
currentPage: currentPage,
|
||||
sid: sid,
|
||||
deviceId: deviceId,
|
||||
fmgSessionId: issSessionId,
|
||||
skey: skey,
|
||||
userId: userId,
|
||||
carId: carId,
|
||||
vehicleYear: vehicleYear,
|
||||
vehicleMake: vehicleMake,
|
||||
vehicleModel: vehicleModel,
|
||||
vehicleStyle: vehicleStyle,
|
||||
hasVin: hasVin,
|
||||
cashOrInsuranceAccountType: cashOrInsuranceAccountType,
|
||||
isVerified: isVerified,
|
||||
coverageStatus: coverageStatus,
|
||||
coverageSubStatus: coverageSubStatus,
|
||||
damageType: damageType,
|
||||
productType: productType,
|
||||
eon: eon,
|
||||
referralNumber: referralNumber,
|
||||
referralSequenceNumber: referralSequenceNumber,
|
||||
referralDate: referralDate,
|
||||
workOrderNumber: workOrderNumber,
|
||||
workOrderId: workOrderId,
|
||||
isPia: isPia,
|
||||
piaType: piaType,
|
||||
parentAccountNumber: parentAccountNumber,
|
||||
settledTenderAmount: settledTenderAmount,
|
||||
recalRequired: recalRequired,
|
||||
recalType: recalType,
|
||||
serviceZipCode: serviceZipCode,
|
||||
providerCtu: providerCtu,
|
||||
appointmentDate: appointmentDate,
|
||||
serviceType: serviceType,
|
||||
promoCodes: promoCodes,
|
||||
hasTechnicianNotes: hasTechnicianNotes,
|
||||
paymentMethod: paymentMethod,
|
||||
isTextingOptedIn: isTextingOptedIn,
|
||||
isEarlyBird: isEarlyBird,
|
||||
insuranceCo: insuranceCo,
|
||||
deductible: deductible,
|
||||
isNoComp: isNoComp,
|
||||
isItac: isItac,
|
||||
subTotalPrice: subTotalPrice,
|
||||
totalPrice: totalPrice,
|
||||
userAgent: userAgent,
|
||||
cashPriceSubTotal: cashPriceSubTotal,
|
||||
billToAccountNumber: billToAccountNumber,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogIssSessionData.method,
|
||||
endpoint: endpoints.LogIssSessionData.url,
|
||||
payload,
|
||||
logApiCall: false,
|
||||
bailoutOnError: false
|
||||
}).then(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
console.log(`Analytics Service Error: ${error.data}`);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
updateContactInfo(contactInfo) {
|
||||
this.order.customer.firstName = contactInfo?.firstName ?? this.order.customer.firstName;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__";
|
|||
process.env.VUE_APP_CUSTOMER_PORTAL_URL = '__VUE_APP_CUSTOMER_PORTAL_URL__';
|
||||
process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "__VUE_APP_GOOGLE_PLACES_API_KEY__";
|
||||
process.env.VUE_APP_SAFELITE_HOP = "__VUE_APP_SAFELITE_HOP__";
|
||||
process.env.VUE_APP_ADYEN_ENVIRONMENT = '__VUE_APP_ADYEN_ENVIRONMENT__';
|
||||
process.env.VUE_APP_ADYEN_CLIENT_KEY = '__VUE_APP_ADYEN_CLIENT_KEY__';
|
||||
|
||||
// GA & GTM
|
||||
process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__";
|
||||
|
|
|
|||
Loading…
Reference in a new issue