Merge branch 'develop' into feature/CSR-1392
This commit is contained in:
commit
ca77f1742b
2 changed files with 53 additions and 4 deletions
|
|
@ -105,6 +105,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "paymentMethod",
|
name: "paymentMethod",
|
||||||
|
|
@ -193,7 +194,56 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return true;
|
// Line Items
|
||||||
|
const packageReqs = !!store.getters.order.lineItems.supportingItems;
|
||||||
|
|
||||||
|
// Service Location
|
||||||
|
const serviceLocation = store.getters.order.serviceLocation;
|
||||||
|
const mobileReqs = !!(
|
||||||
|
serviceLocation.address &&
|
||||||
|
serviceLocation.city &&
|
||||||
|
serviceLocation.state &&
|
||||||
|
serviceLocation.zipCode
|
||||||
|
);
|
||||||
|
|
||||||
|
const providerLocation = serviceLocation.provider.address;
|
||||||
|
const dropOffInshopReqs = !!(
|
||||||
|
providerLocation.streetAddress &&
|
||||||
|
providerLocation.city &&
|
||||||
|
providerLocation.state &&
|
||||||
|
providerLocation.zipCode
|
||||||
|
);
|
||||||
|
|
||||||
|
const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||||
|
|
||||||
|
const serviceLocationReqs =
|
||||||
|
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
|
||||||
|
|
||||||
|
// Insurance
|
||||||
|
const isInsuranceSet = store.getters.order.payment.isInsurance !== null;
|
||||||
|
|
||||||
|
// Schedule
|
||||||
|
const schedule = store.getters.order.schedule;
|
||||||
|
const scheduleReqs = !!(
|
||||||
|
schedule.date &&
|
||||||
|
schedule.startTime &&
|
||||||
|
(!isMobile || schedule.endTime) &&
|
||||||
|
schedule.jobMaxMinutes &&
|
||||||
|
schedule.jobMinMinutes
|
||||||
|
);
|
||||||
|
|
||||||
|
// Customer
|
||||||
|
const customer = store.getters.order.customer;
|
||||||
|
const customerReqs = !!(
|
||||||
|
customer.firstName &&
|
||||||
|
customer.lastName &&
|
||||||
|
customer.phoneNumber &&
|
||||||
|
customer.emailAddress
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
packageReqs && serviceLocationReqs && isInsuranceSet && scheduleReqs && customerReqs
|
||||||
|
);
|
||||||
},
|
},
|
||||||
getPaypalAlert() {
|
getPaypalAlert() {
|
||||||
return store.getters.order.payment.piaErrorCode ? true : false;
|
return store.getters.order.payment.piaErrorCode ? true : false;
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,7 @@ export default {
|
||||||
// damageReqs handles checking for damage, even though it is also required for this section.
|
// damageReqs handles checking for damage, even though it is also required for this section.
|
||||||
const packageReqs = !!(
|
const packageReqs = !!(
|
||||||
(damage.isRepair || lineItems.glassParts) &&
|
(damage.isRepair || lineItems.glassParts) &&
|
||||||
lineItems.supportingItems &&
|
lineItems.supportingItems
|
||||||
lineItems.vaps
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Service Location
|
// Service Location
|
||||||
|
|
@ -208,7 +207,7 @@ export default {
|
||||||
const scheduleReqs = !!(
|
const scheduleReqs = !!(
|
||||||
schedule.date &&
|
schedule.date &&
|
||||||
schedule.startTime &&
|
schedule.startTime &&
|
||||||
schedule.endTime &&
|
(!isMobile || schedule.endTime) &&
|
||||||
schedule.jobMaxMinutes &&
|
schedule.jobMaxMinutes &&
|
||||||
schedule.jobMinMinutes
|
schedule.jobMinMinutes
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue