Merge pull request #458 from Safelite/feature/richardson/SSR-708

Schedule PreReqs
This commit is contained in:
brich1212safe 2023-09-27 13:42:55 -04:00 committed by GitHub
commit 3c464b4fbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 15 deletions

View file

@ -27,6 +27,7 @@ import siteHeader from '@/iss-components/site-header/site-header.vue';
import siteFooter from '@/iss-components/site-footer/site-footer.vue'; import siteFooter from '@/iss-components/site-footer/site-footer.vue';
// Supporting files // Supporting files
import { AppointmentTypeStrings } from '@/constants/schedule-constants.js';
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper'; import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
import settleAllPromises from '@/helpers/layout-helper'; import settleAllPromises from '@/helpers/layout-helper';
import { Form } from 'vee-validate'; import { Form } from 'vee-validate';
@ -67,19 +68,33 @@ export default {
data() { data() {
}, },
methods: methods: {
{ arePagePrerequisitesValid() {
backButtonAction() { const { serviceLocation } = useMainStore().order;
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); const serviceLocationPreReqs = serviceLocation.zipCode
}, && serviceLocation.zipCodeCtu
&& serviceLocation.appointmentType
&& (serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|| serviceLocation.provider.providerNumber);
const paymentInfo = useMainStore().payment.isInsurance !== null;
const supportingItems = useMainStore().lineItems.supportingItems !== null;
const damageInfo =
useMainStore().order.damage.isRepair
|| (useMainStore().order.lineItems?.glassParts != null
&& useMainStore().order.lineItems.glassParts.length > 0);
return serviceLocationPreReqs && paymentInfo && supportingItems && damageInfo;
},
backButtonAction() {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() { forwardButtonAction() {
// validate and save here // validate and save here
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route); this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
}, },
navigateForward() { navigateForward() {
}
} }
}
}; };
</script> </script>

View file

@ -390,6 +390,7 @@ export default {
setData(zipCodeData, serviceabilityDetails, mobileFeePart) { setData(zipCodeData, serviceabilityDetails, mobileFeePart) {
if (zipCodeData) { if (zipCodeData) {
this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase; this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase;
this.zipCodeCtu = zipCodeData.zipCodeCtu;
} }
if (serviceabilityDetails) { if (serviceabilityDetails) {

View file

@ -751,8 +751,10 @@ export const useMainStore = defineStore({
return []; return [];
}); });
availableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems); if (response.data?.lineItems) {
const retAvailableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems);
return retAvailableLineItems;
}
return availableLineItems; return availableLineItems;
}, },
@ -995,7 +997,6 @@ export const useMainStore = defineStore({
this.order.vehicle.registration.firstName = registrationInfo?.firstName; this.order.vehicle.registration.firstName = registrationInfo?.firstName;
this.order.vehicle.registration.lastName = registrationInfo?.lastName; this.order.vehicle.registration.lastName = registrationInfo?.lastName;
}, },
updateServiceLocation(serviceLocationInfo) { updateServiceLocation(serviceLocationInfo) {
state.order.serviceLocation.address = serviceLocationInfo.address; state.order.serviceLocation.address = serviceLocationInfo.address;
state.order.serviceLocation.address2 = serviceLocationInfo.address2; state.order.serviceLocation.address2 = serviceLocationInfo.address2;
@ -1264,7 +1265,6 @@ export const useMainStore = defineStore({
this.order.customer.address.zipCode = customerQuestions.addressQuestions.zipCode; this.order.customer.address.zipCode = customerQuestions.addressQuestions.zipCode;
this.order.customer.firstName = customerQuestions.firstName; this.order.customer.firstName = customerQuestions.firstName;
this.order.customer.lastName = customerQuestions.lastName; this.order.customer.lastName = customerQuestions.lastName;
this.order.serviceLocation.zipCode = customerQuestions.addressQuestions.zipCode;
}, },
savePartQuestionAnswers(partQuestionAnswersArray) { savePartQuestionAnswers(partQuestionAnswersArray) {
// if part question answers have changed, reset subsequent question answers // if part question answers have changed, reset subsequent question answers