From 39d1f9f26a26d414dc28edbc191c9adeeb08dd34 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Tue, 6 May 2025 14:32:11 +0530 Subject: [PATCH 1/4] CASH-597 Heavy truck service location inshop pagination --- src/layouts/service-location/service-location.vue | 8 +++++++- .../service-location/shop-question/shop-question.vue | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 7b3163c87..2dfba347c 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -111,7 +111,8 @@ :selectedAppointmentType="selectedAppointmentType" :shopProviderData="shopProviderData" :isDisplayed="isShopQuestionDisplayed" - cmsWidgetName="ShopQuestionWidget" /> + cmsWidgetName="ShopQuestionWidget" + :isInshopOnly="isInshopOnly" /> @@ -413,6 +414,11 @@ export default { isNoComp() { return store.getters.order.policy.isNoComp; }, + isInshopOnly() { + return ( + this.isServiceableInshop && !this.isServiceableMobile && !this.isServiceableDropoff + ); + }, }, methods: { arePagePrerequisitesValid() { diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 417a3b4c4..76d59be7c 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -77,6 +77,7 @@ export default { cmsWidgetName: String, validationRules: String, isDisplayed: Boolean, + isInshopOnly: Boolean, }, computed: { questionText() { @@ -233,10 +234,13 @@ export default { // nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes // up the component initialization on page load. async handler() { - this.resetAnswers(); + //We do not need to run this handler in case of Inshop only else it will ended running twice function getNextShopsFromList and will cause pagination + if (!this.isInshopOnly) { + this.resetAnswers(); - await nextTick(); - this.getNextShopsFromList(); + await nextTick(); + this.getNextShopsFromList(); + } }, }, shopProviders: { From b564f257860799c98afba2950e870e408b8fe348 Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Thu, 8 May 2025 09:24:08 -0400 Subject: [PATCH 2/4] CASH-593 pass mobile provider number to MSR fees check --- .../service-location-helper/service-location-helper.js | 2 ++ .../service-location-helper.spec.js | 10 ++++++++++ src/store/index.js | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js index 106ed892c..a85b180f9 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js @@ -8,6 +8,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) { } const zipCodeData = await getZipCodeData(serviceZipCode); + const providerData = await getShopProviderData(serviceZipCode); // Get the Mobile Fee Part const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging( @@ -15,6 +16,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) { { serviceZipCode: serviceZipCode, serviceZipCodeCtu: zipCodeData.zipCodeCtu, + mobileProviderNumber: providerData.data.mobileProviderNumber, }, pageNameToLog, false diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js index 5bb41c657..06f34f125 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js @@ -91,6 +91,7 @@ const mockStoreActionPriceOrderItemsAndSaveServerData = storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA; const mockStoreActionGetServiceabilityDetails = storeActions.GET_SERVICEABILITY_DETAILS; const mockStoreActionGetShopTimeSlots = storeActions.GET_SHOP_TIME_SLOTS; +const mockStoreActionGetProviders = storeActions.GET_PROVIDERS; const mockGetShopTimeSlotsGoodAvailability = { data: { @@ -236,6 +237,15 @@ jest.mock("@/mixins/base-mixin.js", () => ({ return Promise.resolve(mockGetShopTimeSlotsLowAvailability); } + + if (actionName === mockStoreActionGetProviders) { + return Promise.resolve({ + data: { + mobileProviderNumber: "001820", + shopProviders: [{}], + }, + }); + } }), }, })); diff --git a/src/store/index.js b/src/store/index.js index 53ec6864e..753d8509b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1736,7 +1736,10 @@ export const actions = { return response; }, - getMobileFeePart(context, { payload: { serviceZipCode, serviceZipCodeCtu }, pageNameToLog }) { + getMobileFeePart( + context, + { payload: { serviceZipCode, serviceZipCodeCtu, mobileProviderNumber }, pageNameToLog } + ) { const serviceType = context.getters.damage.isRepair ? "Repair" : "Install"; const facilityType = "Mobile"; const parentAccountNumber = context.getters.payment.parentAccountNumber; @@ -1754,6 +1757,7 @@ export const actions = { order.serviceLocation?.zipCode; var providerNumber = + mobileProviderNumber ?? serviceZipCodeCtu ?? order.serviceLocation?.provider?.providerNumber ?? order.serviceLocation?.zipCodeCtu; From 69543c0cd3d14b2aa3b4c1c90df33b28ae7278ec Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Thu, 8 May 2025 11:24:24 -0400 Subject: [PATCH 3/4] CASH-376 disable forward nav button when modal is open --- src/layouts/service-location/service-location.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index ef27cbbb8..e10b5033f 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -119,7 +119,9 @@ From 8ddc94a88581ab0a21bd81a08daaba56b7ebe74f Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Thu, 8 May 2025 21:41:35 +0530 Subject: [PATCH 4/4] CASH-602 This is the edge case when we have only inshop service and change the zip for another inshop only services. appointment-type-question is not triggering because no changes were made to the serviceability-details that is causing Inshop service type to get auto select. --- .../appointment-type-question.vue | 21 ++++++++++++------- .../service-location/service-location.vue | 1 + .../shop-question/shop-question.vue | 10 +++------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index 4c1c0d031..cc702529a 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -34,6 +34,7 @@ export default { isServiceableInshop: Boolean, isServiceableDropoff: Boolean, mobileFeeApplies: Boolean, + zipCode: String, }, computed: { questionText() { @@ -47,6 +48,7 @@ export default { const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = this.isServiceableDropoff && !this.$store.getters.damage.isRepair; + const zipCode = this.zipCode; var answers = this.answersFromCms ? this.answersFromCms.filter((answer) => { @@ -87,12 +89,15 @@ export default { watch: { answersToDisplay: { handler(newValue) { - // If there is only one option to display and that option is 'Mobile' then select it - if ( - newValue.length == 1 && - newValue.findIndex((answer) => answer.Name == "Mobile") != -1 - ) { - this.selectedValue = "Mobile"; + // If there is only one option to display and that option is 'Mobile' or 'Inshop' then select it + if (newValue.length == 1) { + const name = newValue[0].Name; + if ( + name === AppointmentTypeStrings.MOBILE || + name === AppointmentTypeStrings.IN_SHOP + ) { + this.selectedValue = name; + } } }, immediate: true, @@ -100,14 +105,14 @@ export default { isMobileOnly: { handler(newValue) { if (newValue) { - this.selectedValue = "Mobile"; + this.selectedValue = AppointmentTypeStrings.MOBILE; } }, }, isInshopOnly: { handler(newValue) { if (newValue) { - this.selectedValue = "Inshop"; + this.selectedValue = AppointmentTypeStrings.IN_SHOP; } }, }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 367211264..b161a6141 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -79,6 +79,7 @@ :isServiceableDropoff="isServiceableDropoff" :isDisplayed="isAppointmentTypeDisplayed" :mobileFeeApplies="mobileFeeApplies" + :zipCode="zipCode" ref="appointmentTypeQuestion" groupName="appointmentTypeQuestion" cmsWidgetName="AppointmentTypeQuestionWidget" diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 76d59be7c..5e85b752b 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -234,13 +234,9 @@ export default { // nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes // up the component initialization on page load. async handler() { - //We do not need to run this handler in case of Inshop only else it will ended running twice function getNextShopsFromList and will cause pagination - if (!this.isInshopOnly) { - this.resetAnswers(); - - await nextTick(); - this.getNextShopsFromList(); - } + await nextTick(); + this.resetAnswers(); + this.getNextShopsFromList(); }, }, shopProviders: {