INSR-7752; Some routing adjustments and related store tweaks for contactinfo
This commit is contained in:
parent
18661e3fd2
commit
7298f0b62f
8 changed files with 82 additions and 65 deletions
|
|
@ -220,14 +220,7 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
const scenario =
|
||||
useMainStore().order.serviceLocation.IsSafeliteProvider
|
||||
=== false
|
||||
? this.navigationScenarios
|
||||
.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP
|
||||
: this.navigationScenarios
|
||||
.CLICKED_FORWARD_WITH_SAFELITE_SHOP;
|
||||
this.$router.navigate(scenario, this.$route);
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ export default {
|
|||
);
|
||||
|
||||
// Contact Info
|
||||
const { contactInfo } = useMainStore().order;
|
||||
const { contactInfo } = useMainStore();
|
||||
const contactInfoReqs = !!(
|
||||
contactInfo.firstName
|
||||
&& contactInfo.lastName
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
:isStackedVertically="true"
|
||||
@backClicked="navigateBack"
|
||||
@backClicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -176,6 +176,7 @@ export default {
|
|||
&& vehicle.model
|
||||
&& vehicle.style
|
||||
);
|
||||
console.log('vehicleReqs:', vehicleReqs);
|
||||
|
||||
// Damage
|
||||
const { isRepair, numberOfChips, glassToReplace } =
|
||||
|
|
@ -184,6 +185,7 @@ export default {
|
|||
(isRepair && numberOfChips)
|
||||
|| (!isRepair && glassToReplace?.length)
|
||||
);
|
||||
console.log('damageReqs:', damageReqs);
|
||||
|
||||
// Service Package
|
||||
const { lineItems } = useMainStore().order;
|
||||
|
|
@ -191,15 +193,18 @@ export default {
|
|||
(isRepair || lineItems.glassParts)
|
||||
&& lineItems.supportingItems
|
||||
);
|
||||
console.log('packageReqs:', packageReqs);
|
||||
|
||||
// Service Location
|
||||
const { serviceLocation } = useMainStore().order;
|
||||
console.log('serviceLocation:', serviceLocation);
|
||||
const mobileReqs = !!(
|
||||
serviceLocation.address
|
||||
&& serviceLocation.city
|
||||
&& serviceLocation.state
|
||||
&& serviceLocation.zipCode
|
||||
);
|
||||
console.log('mobileReqs:', mobileReqs);
|
||||
|
||||
const providerLocation = serviceLocation.provider.address;
|
||||
const dropOffInshopReqs = !!(
|
||||
|
|
@ -208,11 +213,13 @@ export default {
|
|||
&& providerLocation.state
|
||||
&& providerLocation.zipCode
|
||||
);
|
||||
console.log('dropOffInshopReqs:', dropOffInshopReqs);
|
||||
|
||||
const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|
||||
|| serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
|
||||
const serviceLocationReqs =
|
||||
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
|
||||
console.log('serviceLocationReqs:', serviceLocationReqs);
|
||||
|
||||
// Schedule
|
||||
const { date, startTime, endTime, jobMaxMinutes, jobMinMinutes } =
|
||||
|
|
@ -224,19 +231,23 @@ export default {
|
|||
&& jobMaxMinutes
|
||||
&& jobMinMinutes
|
||||
);
|
||||
console.log('scheduleReqs:', scheduleReqs);
|
||||
|
||||
// Customer
|
||||
const { firstName, lastName, emailAddress } = useMainStore().order.customer;
|
||||
const customerReqs = !!(firstName && lastName && emailAddress);
|
||||
console.log('customerReqs:', customerReqs);
|
||||
|
||||
// Contact Info
|
||||
const { contactInfo } = useMainStore().order;
|
||||
const { contactInfo } = useMainStore();
|
||||
console.log('contactInfo:', contactInfo);
|
||||
const contactInfoReqs = !!(
|
||||
contactInfo.firstName
|
||||
&& contactInfo.lastName
|
||||
&& contactInfo.servicePhone
|
||||
&& contactInfo.emailAddress
|
||||
);
|
||||
console.log('contactInfoReqs:', contactInfoReqs);
|
||||
|
||||
return (
|
||||
vehicleReqs
|
||||
|
|
@ -291,6 +302,15 @@ export default {
|
|||
{ [routerParams.SKIP_SAVE_SESSION]: true }
|
||||
);
|
||||
}
|
||||
},
|
||||
backButtonAction() {
|
||||
const scenario = this.mainStore.isMobileAppointment
|
||||
? this.navigationScenarios.CLICKED_BACK_MOBILE
|
||||
: this.navigationScenarios.CLICKED_BACK_INSHOP;
|
||||
this.$router.navigate(
|
||||
scenario,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -479,15 +479,15 @@ export default {
|
|||
authSignature: '',
|
||||
authSignatureStart: '',
|
||||
referralSequenceNumber: useMainStore().order.referralSequenceNumber,
|
||||
emailAddress: useMainStore().order.contactInfo.emailAddress,
|
||||
emailAddress: useMainStore().contactInfo.emailAddress,
|
||||
address1: this.getAddress1(),
|
||||
address2: this.getAddress2(),
|
||||
city: this.getCity(),
|
||||
state: this.getState(),
|
||||
zipCode: this.getZipCode(),
|
||||
firstName: useMainStore().order.contactInfo.firstName,
|
||||
lastName: useMainStore().order.contactInfo.lastName,
|
||||
phoneNumber: useMainStore().order.contactInfo.servicePhone,
|
||||
firstName: useMainStore().contactInfo.firstName,
|
||||
lastName: useMainStore().contactInfo.lastName,
|
||||
phoneNumber: useMainStore().contactInfo.servicePhone,
|
||||
ctu: useMainStore().order.serviceLocation.provider?.address?.zipCodeCtu ?? useMainStore().order.serviceLocation.zipCodeCtu,
|
||||
referralCorrelationId: useMainStore().order.referralCorrelationId,
|
||||
workOrderNumber: this.getWorkOrderNumber(),
|
||||
|
|
@ -593,7 +593,7 @@ export default {
|
|||
);
|
||||
|
||||
// Contact Info
|
||||
const { contactInfo } = useMainStore().order;
|
||||
const { contactInfo } = useMainStore();
|
||||
const contactInfoReqs = !!(
|
||||
contactInfo.firstName
|
||||
&& contactInfo.lastName
|
||||
|
|
|
|||
|
|
@ -195,8 +195,12 @@ export default {
|
|||
}
|
||||
store.updateVaps(this.selectedVaps);
|
||||
|
||||
const scenario = store.isMobileAppointment
|
||||
? this.navigationScenarios.CLICKED_FORWARD_MOBILE
|
||||
: this.navigationScenarios.CLICKED_FORWARD_INSHOP;
|
||||
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
scenario,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@ const navigationScenarios = Object.freeze({
|
|||
CLICKED_FORWARD_WITH_TPA_DISABLED: 'CLICKED_FORWARD_WITH_TPA_DISABLED',
|
||||
CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES: 'CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES',
|
||||
|
||||
// Service Package
|
||||
CLICKED_FORWARD_INSHOP: 'CLICKED_FORWARD_INSHOP',
|
||||
CLICKED_FORWARD_MOBILE: 'CLICKED_FORWARD_MOBILE',
|
||||
|
||||
// Review Page
|
||||
CLICKED_CUSTOMER_EDIT: 'CLICKED_CUSTOMER_EDIT',
|
||||
CLICKED_DAMAGE_EDIT: 'CLICKED_DAMAGE_EDIT',
|
||||
|
|
@ -102,6 +106,8 @@ const navigationScenarios = Object.freeze({
|
|||
CLICKED_VEHICLE_EDIT: 'CLICKED_VEHICLE_EDIT',
|
||||
|
||||
// Payment
|
||||
CLICKED_BACK_INSHOP: 'CLICKED_BACK_INSHOP',
|
||||
CLICKED_BACK_MOBILE: 'CLICKED_BACK_MOBILE',
|
||||
CLICKED_PAY_NOW: 'CLICKED_PAY_NOW',
|
||||
PAY_IN_ADVANCE_ERROR: 'PAY_IN_ADVANCE_ERROR',
|
||||
PAY_IN_ADVANCE_CREDIT_CARD_ERROR: 'PAY_IN_ADVANCE_CREDIT_CARD_ERROR',
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ const routingTable = () => [
|
|||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationIssPageValue: issPageValues.CONTACT_DETAILS
|
||||
destinationIssPageValue: issPageValues.SERVICE_PACKAGES
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_CHANGE_LOCATION,
|
||||
|
|
@ -610,25 +610,8 @@ const routingTable = () => [
|
|||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.SCHEDULE_PAGE
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP,
|
||||
destinationIssPageValue: issPageValues.SERVICE_PACKAGES
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP,
|
||||
destinationIssPageValue: issPageValues.TPA_SUBMIT
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.SERVICE_PACKAGES,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.CONTACT_DETAILS
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationIssPageValue: issPageValues.PAYMENT_METHOD
|
||||
|
|
@ -636,12 +619,33 @@ const routingTable = () => [
|
|||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.PAYMENT_METHOD,
|
||||
issPageValue: issPageValues.SERVICE_PACKAGES,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.SCHEDULE_PAGE
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_INSHOP,
|
||||
destinationIssPageValue: issPageValues.PAYMENT_METHOD
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_MOBILE,
|
||||
destinationIssPageValue: issPageValues.CONTACT_DETAILS
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.PAYMENT_METHOD,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK_INSHOP,
|
||||
destinationIssPageValue: issPageValues.SERVICE_PACKAGES
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK_MOBILE,
|
||||
destinationIssPageValue: issPageValues.CONTACT_DETAILS
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationIssPageValue: issPageValues.ORDER_CONFIRMATION
|
||||
|
|
|
|||
|
|
@ -349,17 +349,20 @@ export const useMainStore = defineStore({
|
|||
lastName: state.order.customer.lastName
|
||||
};
|
||||
},
|
||||
contactInfo: (s) => ({
|
||||
firstName: s.order.contactInfo.firstName ?? s.order.customer.firstName,
|
||||
lastName: s.order.contactInfo.lastName ?? s.order.customer.lastName,
|
||||
emailAddress: s.order.contactInfo.emailAddress ?? s.order.customer.emailAddress,
|
||||
homePhone: s.order.contactInfo.homePhone,
|
||||
alternativePhone: s.order.contactInfo.alternativePhone,
|
||||
servicePhone: s.order.contactInfo.servicePhone,
|
||||
extension: s.order.contactInfo.extension,
|
||||
requestTextUpdates: s.order.contactInfo.requestTextUpdates ?? false,
|
||||
notesForTechnician: s.order.contactInfo.notesForTechnician
|
||||
}),
|
||||
contactInfo: (s) => {
|
||||
const obj = {
|
||||
firstName: s.order.contactInfo.firstName ?? s.order.customer.firstName,
|
||||
lastName: s.order.contactInfo.lastName ?? s.order.customer.lastName,
|
||||
emailAddress: s.order.contactInfo.emailAddress ?? s.order.customer.emailAddress,
|
||||
homePhone: s.order.contactInfo.homePhone,
|
||||
alternativePhone: s.order.contactInfo.alternativePhone,
|
||||
servicePhone: s.order.contactInfo.servicePhone,
|
||||
extension: s.order.contactInfo.extension,
|
||||
requestTextUpdates: s.order.contactInfo.requestTextUpdates ?? false,
|
||||
notesForTechnician: s.order.contactInfo.notesForTechnician
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
scheduleDisplayText: (s) => {
|
||||
const dateModel = convertDateStringToDate(s.order.schedule.date);
|
||||
const readableDate = dateModel?.toLocaleDateString('en-us', {
|
||||
|
|
@ -875,7 +878,7 @@ export const useMainStore = defineStore({
|
|||
logApiCall: true
|
||||
});
|
||||
},
|
||||
getMobileTimeSlots(startDate, endDate) {
|
||||
getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) {
|
||||
const { order } = this;
|
||||
const { vehicle } = this.order;
|
||||
let lineItems = [
|
||||
|
|
@ -921,8 +924,9 @@ export const useMainStore = defineStore({
|
|||
style: vehicle.style,
|
||||
vin: vehicle.vin ?? ''
|
||||
},
|
||||
zipCode: order.serviceLocation.zipCode
|
||||
zipCode: zipCodeOverride ?? order.serviceLocation.zipCode
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.GetMobileTimeSlots.method,
|
||||
endpoint: endpoints.GetMobileTimeSlots.url,
|
||||
|
|
@ -931,7 +935,7 @@ export const useMainStore = defineStore({
|
|||
additionalSuccessEventDataHandler: (response) =>
|
||||
getTimeSlotsAdditionalEventData(
|
||||
response.data.provisionalTriggers,
|
||||
order.serviceLocation.zipCode,
|
||||
zipCodeOverride ?? order.serviceLocation.zipCode,
|
||||
response.data.days?.[0]?.date
|
||||
)
|
||||
});
|
||||
|
|
@ -2717,19 +2721,6 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
saveServiceLocation(serviceLocationInfo) {
|
||||
if (this.order.serviceLocation) {
|
||||
if (
|
||||
serviceLocationInfo.zipCode !== this.order.serviceLocation.zipCode
|
||||
|| !providersEqual(
|
||||
serviceLocationInfo.provider,
|
||||
this.order.serviceLocation.provider
|
||||
)
|
||||
|| serviceLocationInfo.appointmentType
|
||||
!== this.order.serviceLocation.appointmentType
|
||||
) {
|
||||
this.resetSchedule();
|
||||
}
|
||||
}
|
||||
this.updateServiceLocation(serviceLocationInfo);
|
||||
},
|
||||
|
||||
|
|
@ -2881,11 +2872,10 @@ export const useMainStore = defineStore({
|
|||
return JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER));
|
||||
},
|
||||
|
||||
async createSubmittedOrder(submitType) {
|
||||
createSubmittedOrder(submitType) {
|
||||
if (this.hasSubmittedOrder()) {
|
||||
return;
|
||||
}
|
||||
await this.getCarrierAccountInfo();
|
||||
const submittedOrder = this.order;
|
||||
const { experiments } = this.applicationUser;
|
||||
const { issConfig } = this;
|
||||
|
|
|
|||
Loading…
Reference in a new issue