From cfe63885cf7cd623c7c0efeaefa599548caa0659 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 3 May 2024 08:04:33 -0400 Subject: [PATCH 1/2] CSR-2067 CSR-2067 clean up the pre reqs for service location --- .../service-location/service-location.vue | 16 +++++++++------- src/store/index.js | 4 +++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 89b3320fd..93803ebc9 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -139,7 +139,7 @@ import { getShopProviderData, } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; - +import { applicationConfig } from "@/constants/application-config"; import { Provider } from "@/layouts/service-location/classes/provider"; import store from "@/store"; @@ -350,16 +350,18 @@ export default { methods: { arePagePrerequisitesValid() { // insurance drops the recycle fee on replace orders so it won't be in supportingItems - if (store.getters.payment.isInsurance && !store.getters.order.damage.isRepair) { + // we should also have a non cash parent account and a policy number + if (store.getters.payment.isInsurance) { return ( - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null + store.getters.payment.parentAccountNumber !== + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER && + store.getters.order.policy.policyNumber && + store.getters.order.serviceLocation.zipCode ); } else { return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null + store.getters.lineItems.supportingItems && + store.getters.order.serviceLocation.zipCode ); } }, diff --git a/src/store/index.js b/src/store/index.js index 4c0766448..5ffcf5b41 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1383,7 +1383,9 @@ export const actions = { getMobileFeePart(context, { pageNameToLog }) { const damageType = context.getters.damage.isRepair ? "Repair" : "Replace"; const parentAccountNumber = context.getters.payment.parentAccountNumber; - const billToAccountNumber = context.getters.payment.billToAccountNumber; + const billToAccountNumber = context.getters.payment.billToAccountNumber + ? context.getters.payment.billToAccountNumber + : applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER; return globalMethods.callHttpClient({ method: endpoints.GetMobileFeePart.method, From a8ba1b637126053f57e899f6249763aac28a266c Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 3 May 2024 08:31:14 -0400 Subject: [PATCH 2/2] CSR-2067 CSR-2067 fix tests --- .../service-location/service-location.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 93803ebc9..8b76a5e78 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -350,19 +350,26 @@ export default { methods: { arePagePrerequisitesValid() { // insurance drops the recycle fee on replace orders so it won't be in supportingItems - // we should also have a non cash parent account and a policy number if (store.getters.payment.isInsurance) { - return ( + if ( store.getters.payment.parentAccountNumber !== applicationConfig.CASH_PARENT_ACCOUNT_NUMBER && store.getters.order.policy.policyNumber && store.getters.order.serviceLocation.zipCode - ); + ) { + return true; + } else { + return false; + } } else { - return ( + if ( store.getters.lineItems.supportingItems && store.getters.order.serviceLocation.zipCode - ); + ) { + return true; + } else { + return false; + } } }, setData(zipCodeData, serviceabilityDetails, mobileFeePart, shopProviderData) {