INSR-7752; Some routing adjustments and related store tweaks for contactinfo

This commit is contained in:
Alex Humphries 2026-01-30 14:41:13 -05:00
parent 18661e3fd2
commit 7298f0b62f
8 changed files with 82 additions and 65 deletions

View file

@ -220,14 +220,7 @@ export default {
}); });
} }
const scenario = this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
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);
} }
} }
}; };

View file

@ -373,7 +373,7 @@ export default {
); );
// Contact Info // Contact Info
const { contactInfo } = useMainStore().order; const { contactInfo } = useMainStore();
const contactInfoReqs = !!( const contactInfoReqs = !!(
contactInfo.firstName contactInfo.firstName
&& contactInfo.lastName && contactInfo.lastName

View file

@ -52,7 +52,7 @@
cmsWidgetName="SiteFooterWidget" cmsWidgetName="SiteFooterWidget"
:isForwardActionDisabled="!meta.valid" :isForwardActionDisabled="!meta.valid"
:isStackedVertically="true" :isStackedVertically="true"
@backClicked="navigateBack" @backClicked="backButtonAction"
@ForwardClicked="forwardButtonAction" /> @ForwardClicked="forwardButtonAction" />
</div> </div>
</div> </div>
@ -176,6 +176,7 @@ export default {
&& vehicle.model && vehicle.model
&& vehicle.style && vehicle.style
); );
console.log('vehicleReqs:', vehicleReqs);
// Damage // Damage
const { isRepair, numberOfChips, glassToReplace } = const { isRepair, numberOfChips, glassToReplace } =
@ -184,6 +185,7 @@ export default {
(isRepair && numberOfChips) (isRepair && numberOfChips)
|| (!isRepair && glassToReplace?.length) || (!isRepair && glassToReplace?.length)
); );
console.log('damageReqs:', damageReqs);
// Service Package // Service Package
const { lineItems } = useMainStore().order; const { lineItems } = useMainStore().order;
@ -191,15 +193,18 @@ export default {
(isRepair || lineItems.glassParts) (isRepair || lineItems.glassParts)
&& lineItems.supportingItems && lineItems.supportingItems
); );
console.log('packageReqs:', packageReqs);
// Service Location // Service Location
const { serviceLocation } = useMainStore().order; const { serviceLocation } = useMainStore().order;
console.log('serviceLocation:', serviceLocation);
const mobileReqs = !!( const mobileReqs = !!(
serviceLocation.address serviceLocation.address
&& serviceLocation.city && serviceLocation.city
&& serviceLocation.state && serviceLocation.state
&& serviceLocation.zipCode && serviceLocation.zipCode
); );
console.log('mobileReqs:', mobileReqs);
const providerLocation = serviceLocation.provider.address; const providerLocation = serviceLocation.provider.address;
const dropOffInshopReqs = !!( const dropOffInshopReqs = !!(
@ -208,11 +213,13 @@ export default {
&& providerLocation.state && providerLocation.state
&& providerLocation.zipCode && providerLocation.zipCode
); );
console.log('dropOffInshopReqs:', dropOffInshopReqs);
const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|| serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP; || serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
const serviceLocationReqs = const serviceLocationReqs =
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
console.log('serviceLocationReqs:', serviceLocationReqs);
// Schedule // Schedule
const { date, startTime, endTime, jobMaxMinutes, jobMinMinutes } = const { date, startTime, endTime, jobMaxMinutes, jobMinMinutes } =
@ -224,19 +231,23 @@ export default {
&& jobMaxMinutes && jobMaxMinutes
&& jobMinMinutes && jobMinMinutes
); );
console.log('scheduleReqs:', scheduleReqs);
// Customer // Customer
const { firstName, lastName, emailAddress } = useMainStore().order.customer; const { firstName, lastName, emailAddress } = useMainStore().order.customer;
const customerReqs = !!(firstName && lastName && emailAddress); const customerReqs = !!(firstName && lastName && emailAddress);
console.log('customerReqs:', customerReqs);
// Contact Info // Contact Info
const { contactInfo } = useMainStore().order; const { contactInfo } = useMainStore();
console.log('contactInfo:', contactInfo);
const contactInfoReqs = !!( const contactInfoReqs = !!(
contactInfo.firstName contactInfo.firstName
&& contactInfo.lastName && contactInfo.lastName
&& contactInfo.servicePhone && contactInfo.servicePhone
&& contactInfo.emailAddress && contactInfo.emailAddress
); );
console.log('contactInfoReqs:', contactInfoReqs);
return ( return (
vehicleReqs vehicleReqs
@ -291,6 +302,15 @@ export default {
{ [routerParams.SKIP_SAVE_SESSION]: true } { [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
);
} }
} }
}; };

View file

@ -479,15 +479,15 @@ export default {
authSignature: '', authSignature: '',
authSignatureStart: '', authSignatureStart: '',
referralSequenceNumber: useMainStore().order.referralSequenceNumber, referralSequenceNumber: useMainStore().order.referralSequenceNumber,
emailAddress: useMainStore().order.contactInfo.emailAddress, emailAddress: useMainStore().contactInfo.emailAddress,
address1: this.getAddress1(), address1: this.getAddress1(),
address2: this.getAddress2(), address2: this.getAddress2(),
city: this.getCity(), city: this.getCity(),
state: this.getState(), state: this.getState(),
zipCode: this.getZipCode(), zipCode: this.getZipCode(),
firstName: useMainStore().order.contactInfo.firstName, firstName: useMainStore().contactInfo.firstName,
lastName: useMainStore().order.contactInfo.lastName, lastName: useMainStore().contactInfo.lastName,
phoneNumber: useMainStore().order.contactInfo.servicePhone, phoneNumber: useMainStore().contactInfo.servicePhone,
ctu: useMainStore().order.serviceLocation.provider?.address?.zipCodeCtu ?? useMainStore().order.serviceLocation.zipCodeCtu, ctu: useMainStore().order.serviceLocation.provider?.address?.zipCodeCtu ?? useMainStore().order.serviceLocation.zipCodeCtu,
referralCorrelationId: useMainStore().order.referralCorrelationId, referralCorrelationId: useMainStore().order.referralCorrelationId,
workOrderNumber: this.getWorkOrderNumber(), workOrderNumber: this.getWorkOrderNumber(),
@ -593,7 +593,7 @@ export default {
); );
// Contact Info // Contact Info
const { contactInfo } = useMainStore().order; const { contactInfo } = useMainStore();
const contactInfoReqs = !!( const contactInfoReqs = !!(
contactInfo.firstName contactInfo.firstName
&& contactInfo.lastName && contactInfo.lastName

View file

@ -195,8 +195,12 @@ export default {
} }
store.updateVaps(this.selectedVaps); store.updateVaps(this.selectedVaps);
const scenario = store.isMobileAppointment
? this.navigationScenarios.CLICKED_FORWARD_MOBILE
: this.navigationScenarios.CLICKED_FORWARD_INSHOP;
this.$router.navigate( this.$router.navigate(
this.navigationScenarios.CLICKED_FORWARD, scenario,
this.$route this.$route
); );
} }

View file

@ -93,6 +93,10 @@ const navigationScenarios = Object.freeze({
CLICKED_FORWARD_WITH_TPA_DISABLED: 'CLICKED_FORWARD_WITH_TPA_DISABLED', CLICKED_FORWARD_WITH_TPA_DISABLED: 'CLICKED_FORWARD_WITH_TPA_DISABLED',
CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES: 'CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES', 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 // Review Page
CLICKED_CUSTOMER_EDIT: 'CLICKED_CUSTOMER_EDIT', CLICKED_CUSTOMER_EDIT: 'CLICKED_CUSTOMER_EDIT',
CLICKED_DAMAGE_EDIT: 'CLICKED_DAMAGE_EDIT', CLICKED_DAMAGE_EDIT: 'CLICKED_DAMAGE_EDIT',
@ -102,6 +106,8 @@ const navigationScenarios = Object.freeze({
CLICKED_VEHICLE_EDIT: 'CLICKED_VEHICLE_EDIT', CLICKED_VEHICLE_EDIT: 'CLICKED_VEHICLE_EDIT',
// Payment // Payment
CLICKED_BACK_INSHOP: 'CLICKED_BACK_INSHOP',
CLICKED_BACK_MOBILE: 'CLICKED_BACK_MOBILE',
CLICKED_PAY_NOW: 'CLICKED_PAY_NOW', CLICKED_PAY_NOW: 'CLICKED_PAY_NOW',
PAY_IN_ADVANCE_ERROR: 'PAY_IN_ADVANCE_ERROR', PAY_IN_ADVANCE_ERROR: 'PAY_IN_ADVANCE_ERROR',
PAY_IN_ADVANCE_CREDIT_CARD_ERROR: 'PAY_IN_ADVANCE_CREDIT_CARD_ERROR', PAY_IN_ADVANCE_CREDIT_CARD_ERROR: 'PAY_IN_ADVANCE_CREDIT_CARD_ERROR',

View file

@ -597,7 +597,7 @@ const routingTable = () => [
}, },
{ {
scenario: navigationScenarios.CLICKED_FORWARD, scenario: navigationScenarios.CLICKED_FORWARD,
destinationIssPageValue: issPageValues.CONTACT_DETAILS destinationIssPageValue: issPageValues.SERVICE_PACKAGES
}, },
{ {
scenario: navigationScenarios.CLICKED_CHANGE_LOCATION, scenario: navigationScenarios.CLICKED_CHANGE_LOCATION,
@ -610,25 +610,8 @@ const routingTable = () => [
maps: [ maps: [
{ {
scenario: navigationScenarios.CLICKED_BACK, scenario: navigationScenarios.CLICKED_BACK,
destinationIssPageValue: issPageValues.SCHEDULE_PAGE
},
{
scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP,
destinationIssPageValue: issPageValues.SERVICE_PACKAGES 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, scenario: navigationScenarios.CLICKED_FORWARD,
destinationIssPageValue: issPageValues.PAYMENT_METHOD destinationIssPageValue: issPageValues.PAYMENT_METHOD
@ -636,12 +619,33 @@ const routingTable = () => [
] ]
}, },
{ {
issPageValue: issPageValues.PAYMENT_METHOD, issPageValue: issPageValues.SERVICE_PACKAGES,
maps: [ maps: [
{ {
scenario: navigationScenarios.CLICKED_BACK, 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 destinationIssPageValue: issPageValues.SERVICE_PACKAGES
}, },
{
scenario: navigationScenarios.CLICKED_BACK_MOBILE,
destinationIssPageValue: issPageValues.CONTACT_DETAILS
},
{ {
scenario: navigationScenarios.CLICKED_FORWARD, scenario: navigationScenarios.CLICKED_FORWARD,
destinationIssPageValue: issPageValues.ORDER_CONFIRMATION destinationIssPageValue: issPageValues.ORDER_CONFIRMATION

View file

@ -349,17 +349,20 @@ export const useMainStore = defineStore({
lastName: state.order.customer.lastName lastName: state.order.customer.lastName
}; };
}, },
contactInfo: (s) => ({ contactInfo: (s) => {
firstName: s.order.contactInfo.firstName ?? s.order.customer.firstName, const obj = {
lastName: s.order.contactInfo.lastName ?? s.order.customer.lastName, firstName: s.order.contactInfo.firstName ?? s.order.customer.firstName,
emailAddress: s.order.contactInfo.emailAddress ?? s.order.customer.emailAddress, lastName: s.order.contactInfo.lastName ?? s.order.customer.lastName,
homePhone: s.order.contactInfo.homePhone, emailAddress: s.order.contactInfo.emailAddress ?? s.order.customer.emailAddress,
alternativePhone: s.order.contactInfo.alternativePhone, homePhone: s.order.contactInfo.homePhone,
servicePhone: s.order.contactInfo.servicePhone, alternativePhone: s.order.contactInfo.alternativePhone,
extension: s.order.contactInfo.extension, servicePhone: s.order.contactInfo.servicePhone,
requestTextUpdates: s.order.contactInfo.requestTextUpdates ?? false, extension: s.order.contactInfo.extension,
notesForTechnician: s.order.contactInfo.notesForTechnician requestTextUpdates: s.order.contactInfo.requestTextUpdates ?? false,
}), notesForTechnician: s.order.contactInfo.notesForTechnician
};
return obj;
},
scheduleDisplayText: (s) => { scheduleDisplayText: (s) => {
const dateModel = convertDateStringToDate(s.order.schedule.date); const dateModel = convertDateStringToDate(s.order.schedule.date);
const readableDate = dateModel?.toLocaleDateString('en-us', { const readableDate = dateModel?.toLocaleDateString('en-us', {
@ -875,7 +878,7 @@ export const useMainStore = defineStore({
logApiCall: true logApiCall: true
}); });
}, },
getMobileTimeSlots(startDate, endDate) { getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) {
const { order } = this; const { order } = this;
const { vehicle } = this.order; const { vehicle } = this.order;
let lineItems = [ let lineItems = [
@ -921,8 +924,9 @@ export const useMainStore = defineStore({
style: vehicle.style, style: vehicle.style,
vin: vehicle.vin ?? '' vin: vehicle.vin ?? ''
}, },
zipCode: order.serviceLocation.zipCode zipCode: zipCodeOverride ?? order.serviceLocation.zipCode
}; };
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetMobileTimeSlots.method, method: endpoints.GetMobileTimeSlots.method,
endpoint: endpoints.GetMobileTimeSlots.url, endpoint: endpoints.GetMobileTimeSlots.url,
@ -931,7 +935,7 @@ export const useMainStore = defineStore({
additionalSuccessEventDataHandler: (response) => additionalSuccessEventDataHandler: (response) =>
getTimeSlotsAdditionalEventData( getTimeSlotsAdditionalEventData(
response.data.provisionalTriggers, response.data.provisionalTriggers,
order.serviceLocation.zipCode, zipCodeOverride ?? order.serviceLocation.zipCode,
response.data.days?.[0]?.date response.data.days?.[0]?.date
) )
}); });
@ -2717,19 +2721,6 @@ export const useMainStore = defineStore({
}, },
saveServiceLocation(serviceLocationInfo) { 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); this.updateServiceLocation(serviceLocationInfo);
}, },
@ -2881,11 +2872,10 @@ export const useMainStore = defineStore({
return JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER)); return JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER));
}, },
async createSubmittedOrder(submitType) { createSubmittedOrder(submitType) {
if (this.hasSubmittedOrder()) { if (this.hasSubmittedOrder()) {
return; return;
} }
await this.getCarrierAccountInfo();
const submittedOrder = this.order; const submittedOrder = this.order;
const { experiments } = this.applicationUser; const { experiments } = this.applicationUser;
const { issConfig } = this; const { issConfig } = this;