CSR-1072
CSR-1072 insurance orders will remove line items depending on the company. mobile fee, recycle fee, etc. So we can return from heritage with nothing in supporting items causing exceptions when lineItems is no longer required.
This commit is contained in:
parent
17398ce41b
commit
4e1caf8559
5 changed files with 16 additions and 13 deletions
|
|
@ -314,9 +314,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
// Line Items
|
|
||||||
const packageReqs = !!store.getters.order.lineItems.supportingItems;
|
|
||||||
|
|
||||||
// Service Location
|
// Service Location
|
||||||
const serviceLocation = store.getters.order.serviceLocation;
|
const serviceLocation = store.getters.order.serviceLocation;
|
||||||
const mobileReqs = !!(
|
const mobileReqs = !!(
|
||||||
|
|
@ -362,7 +359,7 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
packageReqs && serviceLocationReqs && isInsuranceSet && scheduleReqs && customerReqs
|
serviceLocationReqs && isInsuranceSet && scheduleReqs && customerReqs
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getPaymentMethodFromStore() {
|
getPaymentMethodFromStore() {
|
||||||
|
|
|
||||||
|
|
@ -440,9 +440,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
// Line Items
|
|
||||||
const packageReqs = !!store.getters.order.lineItems.supportingItems;
|
|
||||||
|
|
||||||
// Service Location
|
// Service Location
|
||||||
const serviceLocation = store.getters.order.serviceLocation;
|
const serviceLocation = store.getters.order.serviceLocation;
|
||||||
const mobileReqs = !!(
|
const mobileReqs = !!(
|
||||||
|
|
@ -492,7 +489,6 @@ export default {
|
||||||
(store.getters.order.payment.isPia || !!store.getters.order.payment.piaType);
|
(store.getters.order.payment.isPia || !!store.getters.order.payment.piaType);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
packageReqs &&
|
|
||||||
serviceLocationReqs &&
|
serviceLocationReqs &&
|
||||||
isInsuranceSet &&
|
isInsuranceSet &&
|
||||||
scheduleReqs &&
|
scheduleReqs &&
|
||||||
|
|
|
||||||
|
|
@ -314,14 +314,13 @@ export default {
|
||||||
serviceLocation.provider.providerNumber);
|
serviceLocation.provider.providerNumber);
|
||||||
|
|
||||||
const paymentInfo = store.getters.payment.isInsurance !== null;
|
const paymentInfo = store.getters.payment.isInsurance !== null;
|
||||||
const supportingItems = store.getters.lineItems.supportingItems !== null;
|
|
||||||
|
|
||||||
const damageInfo =
|
const damageInfo =
|
||||||
store.getters.order.damage.isRepair ||
|
store.getters.order.damage.isRepair ||
|
||||||
(store.getters.order.lineItems?.glassParts != null &&
|
(store.getters.order.lineItems?.glassParts != null &&
|
||||||
store.getters.order.lineItems.glassParts.length > 0);
|
store.getters.order.lineItems.glassParts.length > 0);
|
||||||
|
|
||||||
return serviceLocationPreReqs && paymentInfo && supportingItems && damageInfo;
|
return serviceLocationPreReqs && paymentInfo && damageInfo;
|
||||||
},
|
},
|
||||||
async getAvailableDatesMethod(startDate, endDate) {
|
async getAvailableDatesMethod(startDate, endDate) {
|
||||||
const newShopTimeSlots = await getAvailableDates(
|
const newShopTimeSlots = await getAvailableDates(
|
||||||
|
|
@ -348,9 +347,13 @@ export default {
|
||||||
},
|
},
|
||||||
getSelectedTimeSlotInfo() {
|
getSelectedTimeSlotInfo() {
|
||||||
const supportingItems = this.getSupportingItems();
|
const supportingItems = this.getSupportingItems();
|
||||||
const isPremiumAppointment =
|
|
||||||
|
var isPremiumAppointment = false;
|
||||||
|
if (supportingItems) {
|
||||||
|
isPremiumAppointment =
|
||||||
!!supportingItems.filter((lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE)
|
!!supportingItems.filter((lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE)
|
||||||
.length > 0;
|
.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
const selectedTimeSlotInfo = {
|
const selectedTimeSlotInfo = {
|
||||||
timeSlot: store.getters.order.schedule,
|
timeSlot: store.getters.order.schedule,
|
||||||
|
|
@ -461,6 +464,10 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
if (!supportingItems) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added
|
// 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(
|
const removePremiumFeeIndex = supportingItems.findIndex(
|
||||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||||
|
|
|
||||||
|
|
@ -479,7 +479,7 @@ export default {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// if it's not a mobile, then make sure we remove any that may have been added
|
// if it's not a mobile, then make sure we remove any that may have been added
|
||||||
const removeMobileFeeIndex = supportingItems.findIndex(
|
const removeMobileFeeIndex = supportingItems?.findIndex(
|
||||||
(item) => item.partType == MOBILE_FEE_PART_TYPE
|
(item) => item.partType == MOBILE_FEE_PART_TYPE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ const routes = [
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arePagePrerequisitesValid(component)) {
|
if (!arePagePrerequisitesValid(component)) {
|
||||||
|
console.log("Page prereq error: " + component.default.name);
|
||||||
GoToFunnelStartOn404(next);
|
GoToFunnelStartOn404(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,6 +111,7 @@ const routes = [
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isExistingFmgPageName(to.query.fmgPage)) {
|
if (!isExistingFmgPageName(to.query.fmgPage)) {
|
||||||
|
console.log("Not an existing fmg page name:" + to.query.fmgPage);
|
||||||
GoToFunnelStartOn404(next);
|
GoToFunnelStartOn404(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,6 +133,7 @@ const routes = [
|
||||||
.components.default();
|
.components.default();
|
||||||
|
|
||||||
if (!arePagePrerequisitesValid(nextComponent)) {
|
if (!arePagePrerequisitesValid(nextComponent)) {
|
||||||
|
console.log("Page Prereqs not valid for next component: " + nextComponent.default.name);
|
||||||
GoToFunnelStartOn404(next);
|
GoToFunnelStartOn404(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue