From 3630f1b3a72891efde1b6ca2a4775a0313dc4cfa Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 13 Nov 2025 01:14:14 -0500 Subject: [PATCH] CASH-1884 CASH-1884 When a customer navigates from 2.0 to heritage for insurance, receives a 6 digit referral and then returns to 2.0 without using the normal application navigation buttons, then the load session will fail because 2.0 did not use the new referral number when making the request. --- .../methods/helpers/consume-referral-info.js | 24 ++++++++++++++++--- .../methods/helpers/handle-heritage-return.js | 4 +++- src/styles/ux-variables.scss | 4 ++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/router/methods/helpers/consume-referral-info.js b/src/router/methods/helpers/consume-referral-info.js index 5c1dceafc..93ba6f7d6 100644 --- a/src/router/methods/helpers/consume-referral-info.js +++ b/src/router/methods/helpers/consume-referral-info.js @@ -3,15 +3,33 @@ import { queryStrings } from "@/constants/query-strings"; import store from "@/store"; import { storeMutations } from "@/constants/store-mutations"; import { updateOrCreateFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; +import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; export async function consumeReferralQuerystrings() { - const referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER); - const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); - const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); + var referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER); + var parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT); + var correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID); + var referralDate = null; + + // If no referral number in querystring, check if heritage funnel updated last. + // This would indicate a customer that went to heritage but did not return through the + // normal route. ie: left the site in search of a discount and returned without querystrings. + const didHeritageFunnelUpdateLast = getFunnelCookie()?.DidHeritageFunnelUpdateLast; + if (didHeritageFunnelUpdateLast && !referralNumber) { + referralNumber = getFunnelCookie().ReferralNumber; + parentAccount = getFunnelCookie().ReferralParentAccountNumber; + correlationId = getFunnelCookie().ReferralCorrelationId; + referralDate = getFunnelCookie().ReferralDate; + } + if (referralNumber) { store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount); store.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, correlationId); + + if (referralDate) { + store.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate); + } // log(" --update cookie"); updateOrCreateFunnelCookie(); } diff --git a/src/router/methods/helpers/handle-heritage-return.js b/src/router/methods/helpers/handle-heritage-return.js index 7914c8e0e..45f98bbe1 100644 --- a/src/router/methods/helpers/handle-heritage-return.js +++ b/src/router/methods/helpers/handle-heritage-return.js @@ -2,11 +2,13 @@ import { queryStrings } from "@/constants/query-strings"; import { consumeReferralQuerystrings } from "@/router/methods/helpers/consume-referral-info"; import { loadSessionIfPresent } from "@/helpers/heritage-integration/order-helper"; import { routeData } from "@/router/constants/routes"; +import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; export async function handleHeritageReturn(to, from) { const fromHeritageFlag = to.query[queryStrings.FROM_HERITAGE]; + const didHeritageFunnelUpdateLast = getFunnelCookie()?.DidHeritageFunnelUpdateLast; - if (fromHeritageFlag) { + if (fromHeritageFlag || didHeritageFunnelUpdateLast) { // Get new referral info from querystring in case passed there. await consumeReferralQuerystrings(); diff --git a/src/styles/ux-variables.scss b/src/styles/ux-variables.scss index 0c275ad51..770d95b42 100644 --- a/src/styles/ux-variables.scss +++ b/src/styles/ux-variables.scss @@ -123,8 +123,8 @@ $body-color: $gray-600; //Fonts $font-family-sans-serif: UrbanistRegular, Arial, Helvetica, sans-serif; -$font-family-monospace: - UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +$font-family-monospace: UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", + monospace; // stylelint-enable value-keyword-case $font-family-base: $font-family-sans-serif; $font-family-code: $font-family-monospace;