recal logic updates

This commit is contained in:
Katie Kroell 2026-03-27 09:59:17 -04:00
parent 590b5a47c9
commit 23f6693a8c
3 changed files with 8 additions and 4 deletions

View file

@ -147,6 +147,7 @@ import { getPriceOfLineItems } from '@/helpers/price-calculator';
import coverageStatuses from '@/constants/coverage-statuses'; import coverageStatuses from '@/constants/coverage-statuses';
import coverageType from '@/constants/coverage-type'; import coverageType from '@/constants/coverage-type';
import oemEndorsementModal from '@/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue'; import oemEndorsementModal from '@/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue';
import { containsRecalParts } from '@/helpers/recal-helper';
const RECAL_MODAL_REF_NAME = 'RecalModal'; const RECAL_MODAL_REF_NAME = 'RecalModal';
const CANCEL_CLAIM_REF_NAME = 'CancelClaimModal'; const CANCEL_CLAIM_REF_NAME = 'CancelClaimModal';
@ -305,10 +306,11 @@ export default {
}, },
isADAS() { isADAS() {
const { glassParts } = useMainStore().order.lineItems; const { glassParts } = useMainStore().order.lineItems;
const orderContainsRecalPart = containsRecalParts(glassParts);
return ( return (
glassParts !== null glassParts !== null
&& !!glassParts.find((part) => part.requiresRecalibration) && !!glassParts.find((part) => part.requiresRecalibration)
&& !!glassParts.find((part) => part.canSafeliteRecalibrate) && orderContainsRecalPart
); );
}, },
totalServicePrice() { totalServicePrice() {

View file

@ -421,8 +421,9 @@ export default {
displayRecalAckModal() { displayRecalAckModal() {
// if any of the glass parts contain an item with the requiresRecalibration flag set to true // if any of the glass parts contain an item with the requiresRecalibration flag set to true
// and the order does not contain a recalibration part, show the recalibration acknowledgement modal // and the order does not contain a recalibration part, show the recalibration acknowledgement modal
const containsRecalPart = containsRecalParts(useMainStore().order.lineItems); const { glassParts } = useMainStore().order.lineItems;
const hasPartWithRecalRequirement = anyPartWithRequiresRecalFlag(useMainStore().order.lineItems); const containsRecalPart = containsRecalParts(glassParts);
const hasPartWithRecalRequirement = anyPartWithRequiresRecalFlag(glassParts);
if (!containsRecalPart && hasPartWithRecalRequirement && !this.isAcknowledged) { if (!containsRecalPart && hasPartWithRecalRequirement && !this.isAcknowledged) {
return true; return true;

View file

@ -23,6 +23,7 @@ import partTypeStrings from '@/constants/part-type-strings';
import { useMainStore } from '@/store'; import { useMainStore } from '@/store';
import { getPriceOfLineItem } from '@/helpers/price-calculator'; import { getPriceOfLineItem } from '@/helpers/price-calculator';
import { shallowRef } from 'vue'; import { shallowRef } from 'vue';
import { containsRecalParts } from '@/helpers/recal-helper';
const glassLocations = damageLocationsSelected; const glassLocations = damageLocationsSelected;
@ -100,7 +101,7 @@ export default {
return modifiedAnswers; return modifiedAnswers;
}, },
isRecalibrationOnOrder() { isRecalibrationOnOrder() {
return this.mainStore.hasRecalibrationPart; return this.mainStore.hasRecalibrationPart && containsRecalParts(this.mainStore.order.lineItems);
}, },
frontWipersApplicableForTierTwo() { frontWipersApplicableForTierTwo() {
const frontWipersAreAvailable = this.lineItemsContainsPartType(partTypeStrings.FRONT_WIPER); const frontWipersAreAvailable = this.lineItemsContainsPartType(partTypeStrings.FRONT_WIPER);