From 1e19d6abe637276e5862d5d016384304409c089c Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Thu, 9 Oct 2025 14:55:08 -0400 Subject: [PATCH 1/5] CASH-1640 | Remove pricing and taxing from payment --- src/layouts/payment/payment.spec.js | 1 - src/layouts/payment/payment.vue | 114 +--------------------------- 2 files changed, 3 insertions(+), 112 deletions(-) diff --git a/src/layouts/payment/payment.spec.js b/src/layouts/payment/payment.spec.js index ad98814d2..1b36d0644 100644 --- a/src/layouts/payment/payment.spec.js +++ b/src/layouts/payment/payment.spec.js @@ -319,7 +319,6 @@ describe("payment.vue", () => { ); // Assert - expect(vmMock.availableVaps).not.toBeUndefined(); expect(vmMock.lineItems).not.toBeUndefined(); expect(vmMock.setCmsContent).toBeCalled(); diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 992795321..b8e481174 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -42,7 +42,7 @@ { vm.setCmsContent(resultMap.cmsContent); - vm.availableVaps = taxedVaps; - vm.lineItems = lineItems; + vm.lineItems = deepClone(store.getters.order.lineItems); vm.$nextTick(() => { if (vm.$refs.cart) { From 1d603abbe26c67e793f17fc8b578cdc22325ebb8 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 14 Oct 2025 08:13:05 -0400 Subject: [PATCH 2/5] CASH-1640 | Fix promo staying on order before tax call is made --- src/layouts/payment-method/payment-method.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 1042e30fe..f96e0d5cf 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -35,7 +35,7 @@ :isNoComp="isNoComp" :isExpandedOnLoad="false" :isMSRFeeApplicable="isMSRFeeApplicable" - @itemRemoved="reTaxItemsOnOrder" /> + @itemRemoved="evaluatePromosAndTaxItemsOnOrder" /> 0; + const hasActivePromos = this.lineItems.promos.length > 0; + if (hasInactivePromos || hasActivePromos) { + await this.revalidatePromos(); + } this.lineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { From 56d9ecbc03c37250a537276c6ed70426c31bc598 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sat, 18 Oct 2025 10:04:30 -0400 Subject: [PATCH 3/5] CASH-1637 CASH-1637 this is no longer a GA event and will be implemented with kinesis/snowflake next sprint --- src/constants/analytics.js | 3 -- src/mixins/analytics-mixin.js | 67 -------------------------------- src/router/methods/after-each.js | 3 -- 3 files changed, 73 deletions(-) diff --git a/src/constants/analytics.js b/src/constants/analytics.js index 77bb78a3e..fe43be06d 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -7,8 +7,6 @@ const analyticsPageEvents = { const GaEvents = { GENERIC_EVENT: "event", PAGE_VIEW_EVENT: "logPageview", - FMG_DATA_EVENT_1: "logEvent1", - FMG_DATA_EVENT_2: "logEvent2", }; const GaCategories = { @@ -16,7 +14,6 @@ const GaCategories = { EVOX: "Evox", APPOINTMENT: "Appointment", SERVICE_LOCATION: "service-location", - FMG_SESSION_DATA: "fmg_session_data", }; const GaActions = { diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index f5a7d10e0..ef5735bc3 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -200,73 +200,6 @@ export default { await this.logPageView(analyticsPageEvents.ENTRY); }, - async pushFmgDataToGA() { - const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder(); - const submittedOrder = baseMixin.methods.getSubmittedOrder(); - const order = hasSubmittedOrder ? submittedOrder : store.getters.order; - - //event 1 - var label = {}; - label.carId = order?.vehicle?.carId; - label.hasVin = order?.vehicle?.vin ? true : false; - label.cashOrInsuranceAccountType = order?.payment?.isInsurance ? "Insurance" : "Cash"; - label.damageType = order?.damage?.isRepair ? "Repair" : "Replace"; - label.productType = order?.damage?.glassToReplace; - label.recalRequired = containsRecalParts(order?.lineItems); - label.recalType = getRecalPartNumbers(order?.lineItems?.glassParts); - label.serviceZipCode = order?.serviceLocation?.provider?.address?.zipCode - ? order?.serviceLocation?.provider?.address?.zipCode - : order?.serviceLocation?.zipCode; - label.providerCtu = order?.serviceLocation?.provider?.address?.zipCodeCtu - ? order?.serviceLocation?.provider?.address?.zipCodeCtu - : order?.serviceLocation?.zipCodeCtu; - label.subTotalPrice = getSubTotal(order?.lineItems); - label.totalPrice = getAmountDue(order?.lineItems, true); - - await this.pushEventToGA( - GaCategories.FMG_SESSION_DATA, - GaEvents.FMG_DATA_EVENT_1, - JSON.stringify(label), - true, - null, - null - ); - - //event 2 - const isEarlyBird = order?.lineItems?.supportingItems?.find( - (lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD - ); - - const promoCodes = Array.isArray(order?.lineItems?.promos) - ? order?.lineItems?.promos - .map((item) => item.promoCode) - .filter((code) => code) - .join(", ") - : ""; - - label = {}; - label.serviceType = order?.serviceLocation?.appointmentType; - label.promoCodes = promoCodes; - label.hasTechnicianNotes = order?.serviceLocation?.techNotes ? true : false; - label.paymentMethod = order?.payment?.piaType; - label.isTextingOptedIn = order?.customer?.isSmsOptIn ? true : false; - label.isEarlyBird = isEarlyBird ? true : false; - label.insuranceCo = order?.policy?.insuranceCompanyName; - label.deductible = order?.policy?.currentDeductible; - label.isVerified = order?.payment?.insuranceCoverage?.isVerified; - label.isNoComp = order?.policy?.isNoComp; - label.isItac = order?.policy?.isItac; - - await this.pushEventToGA( - GaCategories.FMG_SESSION_DATA, - GaEvents.FMG_DATA_EVENT_2, - JSON.stringify(label), - true, - null, - null - ); - }, - pushOrderToDataLayer() { // helper check for if an object is defined (but maybe falsey) const isDefined = (x) => x !== null && x !== undefined; diff --git a/src/router/methods/after-each.js b/src/router/methods/after-each.js index 7be0e5ce0..27cecffde 100644 --- a/src/router/methods/after-each.js +++ b/src/router/methods/after-each.js @@ -12,7 +12,4 @@ export async function afterEach(to, from) { // Push current order status to Data Layer analyticsMixin.methods.pushOrderToDataLayer(); - - // Push session data GA events for Analytics - analyticsMixin.methods.pushFmgDataToGA(); } From b49a66b5991aa884df8dd1863273806ddd9f2261 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sat, 18 Oct 2025 10:30:27 -0400 Subject: [PATCH 4/5] CASH-1637 CASH-1637 function that used GA got reverted out but needed added back with the new endpoint that logs via kinesis --- src/mixins/analytics-mixin.js | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index ef5735bc3..f87f72ec9 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -200,6 +200,94 @@ export default { await this.logPageView(analyticsPageEvents.ENTRY); }, + // 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. + async pushFmgSessionData() { + const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder(); + const submittedOrder = baseMixin.methods.getSubmittedOrder(); + const order = hasSubmittedOrder ? submittedOrder : store.getters.order; + + const hasSubmittedApplicationUser = baseMixin.methods.hasSubmittedApplicationUser(); + const submittedApplicationUser = baseMixin.methods.getSubmittedApplicationUser(); + const applicationUser = hasSubmittedApplicationUser + ? submittedApplicationUser + : store.getters.applicationUser; + + const isEarlyBird = order?.lineItems?.supportingItems?.find( + (lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD + ); + + 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}` + ); + + var sessionData = {}; + sessionData.currentPage = getPageNameFromRouter(); + sessionData.sid = getSessionIdValue(); + sessionData.deviceId = getDeviceIdValue(); + sessionData.fmgSessionId = applicationUser?.savedSessionId; + 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 = order?.payment?.isInsurance + ? "Insurance" + : "Cash"; + sessionData.damageType = order?.damage?.isRepair ? "Repair" : "Replace"; + sessionData.productType = glassProducts; + 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 = order?.payment?.isPia ?? false; + sessionData.piaType = order?.payment?.piaType; + sessionData.parentAccountNumber = order?.payment?.parentAccountNumber; + sessionData.settledTenderAmount = order?.settledTenderAmount; + sessionData.recalRequired = containsRecalParts(order?.lineItems); + 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 = `${order?.schedule?.date} ${order?.schedule?.startTime}`; + sessionData.serviceType = order?.serviceLocation?.appointmentType; + sessionData.promoCodes = promoCodes; + sessionData.hasTechnicianNotes = order?.serviceLocation?.techNotes ? true : false; + sessionData.paymentMethod = order?.payment?.piaType; + sessionData.isTextingOptedIn = order?.customer?.isSmsOptIn ? true : false; + sessionData.isEarlyBird = isEarlyBird ? true : false; + sessionData.insuranceCo = order?.policy?.insuranceCompanyName; + sessionData.deductible = order?.policy?.currentDeductible; + sessionData.isVerified = order?.payment?.insuranceCoverage?.isVerified ?? false; + sessionData.isNoComp = order?.policy?.isNoComp; + sessionData.isItac = order?.policy?.isItac; + sessionData.subTotalPrice = getSubTotal(order?.lineItems); + sessionData.totalPrice = getAmountDue(order?.lineItems, true); + + await baseMixin.methods.dispatchStoreAction( + storeActions.LOG_FMG_SESSION_DATA, + sessionData, + false + ); + }, + pushOrderToDataLayer() { // helper check for if an object is defined (but maybe falsey) const isDefined = (x) => x !== null && x !== undefined; From f6aca0046c1163867b8145bb2cf2fdf6bcc64c73 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sat, 18 Oct 2025 10:38:19 -0400 Subject: [PATCH 5/5] CASH-1637 pretier --- src/mixins/analytics-mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index f87f72ec9..fbaccb113 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -200,7 +200,7 @@ export default { await this.logPageView(analyticsPageEvents.ENTRY); }, - // This sends session data to the session logging endpoint on the analytics service. + // 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.