From 9f3b901ce2fb58bcc7408c495de18274cf9fb164 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 21 Mar 2025 10:06:14 -0400 Subject: [PATCH 1/3] CASH-415 CASH-415 do not get the pricing by day part or price it when insurance or in the control variation of the experiment --- src/layouts/schedule/schedule.vue | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index da3b3a69b..5c9708eac 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -306,7 +306,7 @@ export default { }); // Get pricingByDayUpcharge needed for Pricing By Day - const pricingByDayUpchargePartPromise = getPricingByDayPartWithPrice(); + const pricingByDayUpchargePartPromise = showPricingByDay ? getPricingByDayPartWithPrice() : null; const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_MOBILE_PREMIUM_FEE, @@ -354,10 +354,7 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); - const pricingByDayUpcharge = await baseMixin.methods.getTotalLineItemPrice( - resultMap.pricingByDayUpchargePart, - false - ); + const pricingByDayUpcharge = showPricingByDay ? await baseMixin.methods.getTotalLineItemPrice(resultMap.pricingByDayUpchargePart,false) : null; const datePickerInitialData = resultMap.datePickerInitialData; datePickerInitialData.pricingByDayBasePrice = pricingByDayBasePrice; @@ -626,24 +623,26 @@ export default { const supportingItems = this.getSupportingItems(); // if we have a pricing by day upcharge, then save/update supporting items with it - const pricingByDayUpchargeFeeIndex = supportingItems?.findIndex( - (item) => item.partType == PRICING_BY_DAY_PART_TYPE - ); + if (this.showPricingByDay) { + const pricingByDayUpchargeFeeIndex = supportingItems?.findIndex( + (item) => item.partType == PRICING_BY_DAY_PART_TYPE + ); - if (this.includePricingByDayUpcharge) { - if (pricingByDayUpchargeFeeIndex > -1) { - supportingItems[pricingByDayUpchargeFeeIndex].laborAmount = - this.pricingByDayUpchargeLineItem.laborAmount; - supportingItems[pricingByDayUpchargeFeeIndex].sellingPrice = - this.pricingByDayUpchargeLineItem.sellingPrice; - supportingItems[pricingByDayUpchargeFeeIndex].kitPrice = - this.pricingByDayUpchargeLineItem.kitPrice; + if (this.includePricingByDayUpcharge) { + if (pricingByDayUpchargeFeeIndex > -1) { + supportingItems[pricingByDayUpchargeFeeIndex].laborAmount = + this.pricingByDayUpchargeLineItem.laborAmount; + supportingItems[pricingByDayUpchargeFeeIndex].sellingPrice = + this.pricingByDayUpchargeLineItem.sellingPrice; + supportingItems[pricingByDayUpchargeFeeIndex].kitPrice = + this.pricingByDayUpchargeLineItem.kitPrice; + } else { + supportingItems.push(this.pricingByDayUpchargeLineItem); + } } else { - supportingItems.push(this.pricingByDayUpchargeLineItem); - } - } else { - if (pricingByDayUpchargeFeeIndex >= 0) { - supportingItems.splice(pricingByDayUpchargeFeeIndex, 1); + if (pricingByDayUpchargeFeeIndex >= 0) { + supportingItems.splice(pricingByDayUpchargeFeeIndex, 1); + } } } @@ -672,12 +671,14 @@ export default { } // if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added - const removePremiumFeeIndex = supportingItems.findIndex( - (item) => item.partType == PREMIUM_FEE_PART_TYPE - ); + if (this.showPricingByDay) { + const removePremiumFeeIndex = supportingItems.findIndex( + (item) => item.partType == PREMIUM_FEE_PART_TYPE + ); - if (removePremiumFeeIndex >= 0) { - supportingItems.splice(removePremiumFeeIndex, 1); + if (removePremiumFeeIndex >= 0) { + supportingItems.splice(removePremiumFeeIndex, 1); + } } } From 73152239eed0e0c559e4894278803ff046e62b3e Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 21 Mar 2025 10:11:49 -0400 Subject: [PATCH 2/3] prettier --- src/layouts/schedule/schedule.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 5c9708eac..5ecf88ac0 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -306,7 +306,9 @@ export default { }); // Get pricingByDayUpcharge needed for Pricing By Day - const pricingByDayUpchargePartPromise = showPricingByDay ? getPricingByDayPartWithPrice() : null; + const pricingByDayUpchargePartPromise = showPricingByDay + ? getPricingByDayPartWithPrice() + : null; const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_MOBILE_PREMIUM_FEE, @@ -354,7 +356,12 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); - const pricingByDayUpcharge = showPricingByDay ? await baseMixin.methods.getTotalLineItemPrice(resultMap.pricingByDayUpchargePart,false) : null; + const pricingByDayUpcharge = showPricingByDay + ? await baseMixin.methods.getTotalLineItemPrice( + resultMap.pricingByDayUpchargePart, + false + ) + : null; const datePickerInitialData = resultMap.datePickerInitialData; datePickerInitialData.pricingByDayBasePrice = pricingByDayBasePrice; From aee40ae184070286a73efc5ab0c62c760df795f5 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 21 Mar 2025 10:55:20 -0400 Subject: [PATCH 3/3] CASH-415 CASH-415 wrong block check --- src/layouts/schedule/schedule.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 5ecf88ac0..63e4a3775 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -678,14 +678,12 @@ export default { } // if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added - if (this.showPricingByDay) { - const removePremiumFeeIndex = supportingItems.findIndex( - (item) => item.partType == PREMIUM_FEE_PART_TYPE - ); + const removePremiumFeeIndex = supportingItems.findIndex( + (item) => item.partType == PREMIUM_FEE_PART_TYPE + ); - if (removePremiumFeeIndex >= 0) { - supportingItems.splice(removePremiumFeeIndex, 1); - } + if (removePremiumFeeIndex >= 0) { + supportingItems.splice(removePremiumFeeIndex, 1); } }