diff --git a/src/constants/schedule-constants.js b/src/constants/schedule-constants.js index eaa0d5fa..a728f1d4 100644 --- a/src/constants/schedule-constants.js +++ b/src/constants/schedule-constants.js @@ -1,6 +1,7 @@ const AppointmentTypeStrings = { IN_SHOP: 'Inshop', MOBILE: 'Mobile', + MOBILE_INSURANCE: 'Mobile-Insurance', DROP_OFF: 'Dropoff' }; const PREMIUM_FEE_PART_TYPE = 'EARLY BIRD'; diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index 9166c994..f1bc7677 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -140,8 +140,6 @@ export default { async beforeRouteEnter(to, from, next) { // Call APIs const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage); - const wipersPromise = await useMainStore().getWipers(); - const rainDefensePromise = await useMainStore().getRainDefense(); const supportingItemsPromise = await useMainStore().getSupportingItems(); // Settle promises and get results @@ -150,14 +148,6 @@ export default { resultKey: 'cmsContent', promise: cmsContentPromise }, - { - resultKey: 'wipers', - promise: wipersPromise - }, - { - resultKey: 'rainDefense', - promise: rainDefensePromise - }, { resultKey: 'supportingItems', promise: supportingItemsPromise @@ -169,9 +159,7 @@ export default { ? JSON.parse(JSON.stringify(useMainStore().order.lineItems.glassParts)) : []; const availableLineItems = [ - resultMap.rainDefense, ...(resultMap.supportingItems ?? []), - ...(resultMap.wipers ?? []), ...(clonedGlassParts ?? []) ]; @@ -357,6 +345,7 @@ export default { return this.navigateForward(); }, async navigateForward() { + useMainStore().updatePolicyITACFlag(this.verifiedITAC); if (this.unverified || this.verifiedDeductible) { this.mainStore.saveSupportingItems(this.supportingItems); this.$router.navigate( 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 25e7a529..c8eb4d56 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 @@ -51,13 +51,15 @@ export default { return this.getCmsContent(this.cmsWidgetName, 'Answers'); }, answersToDisplay() { - const shouldShowMobile = this.isServiceableMobile; + const shouldShowMobile = this.isServiceableMobile && this.isITAC; + const shouldShowMobileInsurance = this.isServiceableMobile && !this.isITAC; const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = this.isServiceableInshop && !useMainStore().damage.isRepair; return this.answersFromCms ? this.answersFromCms.filter((answer) => ( (answer.Name === AppointmentTypeStrings.IN_SHOP && shouldShowInshop) || (answer.Name === AppointmentTypeStrings.MOBILE && shouldShowMobile) + || (answer.Name === AppointmentTypeStrings.MOBILE_INSURANCE && shouldShowMobileInsurance) || (answer.Name === AppointmentTypeStrings.DROP_OFF && shouldShowDropoff) )) : []; @@ -70,6 +72,9 @@ export default { this.$emit('update:modelValue', newValue); } }, + isITAC() { + return useMainStore().policy.isITAC; + }, isMobileOnly() { return this.isServiceableMobile && !this.isServiceableInshop; } @@ -80,9 +85,14 @@ export default { // 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 + && newValue.findIndex((answer) => (answer.Name === AppointmentTypeStrings.MOBILE + || answer.Name === AppointmentTypeStrings.MOBILE_INSURANCE)) !== -1 ) { - this.selectedValues = 'Mobile'; + if (this.isITAC) { + this.selectedValues = AppointmentTypeStrings.MOBILE; + } else { + this.selectedValues = AppointmentTypeStrings.MOBILE_INSURANCE; + } } }, immediate: true @@ -90,7 +100,11 @@ export default { isMobileOnly: { handler(newValue) { if (newValue) { - this.selectedValues = 'Mobile'; + if (this.isITAC) { + this.selectedValues = AppointmentTypeStrings.MOBILE; + } else { + this.selectedValues = AppointmentTypeStrings.MOBILE_INSURANCE; + } } } } diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index d6d850b6..3829dd76 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -31,6 +31,7 @@ @@ -81,6 +82,7 @@ import addressQuestions from '@/iss-components/address-questions/address-questio import vehicleProtectedQuestion from '@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue'; // Helpers +import { useMainStore } from '@/store'; import { getPricedMobileFeePart, getServiceabilityDetails, @@ -167,6 +169,9 @@ export default { }; }, computed: { + isITAC() { + return useMainStore().policy.isITAC; + }, mobileLocationLinkPromptText() { return this.getCmsContent(this.linkWidgetName, 'HeaderText'); }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 75b735f7..d0b8af66 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -59,7 +59,7 @@ cmsWidgetName="AppointmentTypeQuestionWidget" validationRules="option-required" />