Merge pull request #1101 from Safelite/feature/CSR-1144

Feature/csr 1144
This commit is contained in:
CarlNation 2023-05-17 15:17:43 -04:00 committed by GitHub
commit 9f0f7ae5bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 26 deletions

View file

@ -61,6 +61,7 @@ const storeActions = {
SAVE_VEHICLE_DAMAGE: "saveVehicleDamage",
SAVE_VIN_LOOKUP: "saveVinLookup",
SAVE_SERVICE_LOCATION: "saveServiceLocation",
SAVE_SCHEDULE: "saveSchedule",
SAVE_EMAIL: "saveEmail",
SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup",
SAVE_VIN: "saveVin",

View file

@ -33,6 +33,7 @@ const storeMutations = {
UPDATE_REGISTRATION: "updateRegistration",
UPDATE_SERVICE_LOCATION: "updateServiceLocation",
UPDATE_SCHEDULE: "updateSchedule",
UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress",

View file

@ -174,7 +174,19 @@ export default {
backButtonAction() {
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() {
async forwardButtonAction() {
//TODO: replace properties with real values once they are available
await this.dispatchStoreAction(
this.storeActions.SAVE_SCHEDULE,
{
date: "2023-07-04T00:00:00",
startTime: "2023-07-04T12:00:00",
endTime: "2023-07-04T17:00:00",
routeCode: "03341-01820-S-B*20232*11 AM",
},
false
);
navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal });
},
},

View file

@ -136,10 +136,12 @@ defineRule("mobile-location-required", (value) => {
const defaultProvider = {
providerNumber: null,
address: null,
city: null,
state: null,
zip: null,
address: {
streetAddress: null,
city: null,
state: null,
zip: null,
},
};
export default {
@ -393,10 +395,12 @@ export default {
isVehicleProtected: this.isVehicleProtected,
provider: {
providerNumber: this.selectedProvider?.providerNumber,
address: this.selectedProvider?.address?.streetAddress,
city: this.selectedProvider?.address?.city,
state: this.selectedProvider?.address?.state,
zip: this.selectedProvider?.address?.zipCode,
address: {
streetAddress: this.selectedProvider?.address?.streetAddress,
city: this.selectedProvider?.address?.city,
state: this.selectedProvider?.address?.state,
zip: this.selectedProvider?.address?.zipCode,
},
},
},
false

View file

@ -46,10 +46,12 @@ const getDefaultState = () => {
appointmentType: null,
provider: {
providerNumber: null,
address: null,
city: null,
state: null,
zip: null,
address: {
streetAddress: null,
city: null,
state: null,
zip: null,
},
},
},
customer: {
@ -77,6 +79,12 @@ const getDefaultState = () => {
},
parentAccountNumber: 0,
},
schedule: {
date: null,
startTime: null,
endTime: null,
routeCode: null,
},
referralNumber: null,
referralDate: null,
referralCorrelationId: null,
@ -244,10 +252,22 @@ export const mutations = {
if (serviceLocationInfo.provider) {
state.order.serviceLocation.provider.providerNumber =
serviceLocationInfo.provider?.providerNumber;
state.order.serviceLocation.provider.address = serviceLocationInfo.provider?.address;
state.order.serviceLocation.provider.city = serviceLocationInfo.provider?.city;
state.order.serviceLocation.provider.state = serviceLocationInfo.provider?.state;
state.order.serviceLocation.provider.zip = serviceLocationInfo.provider?.zip;
state.order.serviceLocation.provider.address.streetAddress =
serviceLocationInfo.provider?.address?.streetAddress;
state.order.serviceLocation.provider.address.city =
serviceLocationInfo.provider?.address?.city;
state.order.serviceLocation.provider.address.state =
serviceLocationInfo.provider?.address?.state;
state.order.serviceLocation.provider.address.zip =
serviceLocationInfo.provider?.address?.zip;
}
},
updateSchedule(state, scheduleInfo) {
if (scheduleInfo) {
state.order.schedule.date = scheduleInfo.date;
state.order.schedule.startTime = scheduleInfo.startTime;
state.order.schedule.endTime = scheduleInfo.endTime;
state.order.schedule.routeCode = scheduleInfo.routeCode;
}
},
@ -394,14 +414,14 @@ export const mutations = {
state.order.serviceLocation.provider.providerNumber =
sessionInformation.order.serviceLocation.provider?.providerNumber;
state.order.serviceLocation.provider.address =
sessionInformation.order.serviceLocation.provider?.address;
state.order.serviceLocation.provider.address.streetAddress =
sessionInformation.order.serviceLocation.provider?.address?.streetAddress;
state.order.serviceLocation.provider.city =
sessionInformation.order.serviceLocation.provider?.city;
sessionInformation.order.serviceLocation.provider?.address?.city;
state.order.serviceLocation.provider.state =
sessionInformation.order.serviceLocation.provider?.state;
sessionInformation.order.serviceLocation.provider?.address?.state;
state.order.serviceLocation.provider.zip =
sessionInformation.order.serviceLocation.provider?.zip;
sessionInformation.order.serviceLocation.provider?.address?.zip;
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
state.order.payment.insuranceCoverage.isVerified =
@ -415,6 +435,11 @@ export const mutations = {
state.applicationUser.crmCustomerId = sessionInformation.applicationUser.crmCustomerId;
state.applicationUser.pageData = sessionInformation.applicationUser.pageData;
state.applicationUser.lastPage = sessionInformation.applicationUser.lastPage;
state.order.schedule.date = sessionInformation.order.schedule?.date;
state.order.schedule.startTime = sessionInformation.order.schedule?.startTime;
state.order.schedule.endTime = sessionInformation.order.schedule?.endTime;
state.order.schedule.routeCode = sessionInformation.order.schedule?.routeCode;
},
updateExperiments(state, experiments) {
state.applicationUser.experiments = experiments;
@ -1166,12 +1191,21 @@ export const actions = {
isVehicleProtected: order.serviceLocation.isVehicleProtected,
provider: {
providerNumber: order.serviceLocation.provider?.providerNumber,
address: order.serviceLocation.provider?.address,
city: order.serviceLocation.provider?.city,
state: order.serviceLocation.provider?.state,
zip: order.serviceLocation.provider?.zip,
address: {
streetAddress:
order.serviceLocation.provider?.address?.streetAddress,
city: order.serviceLocation.provider?.address?.city,
state: order.serviceLocation.provider?.address?.state,
zip: order.serviceLocation.provider?.address?.zip,
},
},
},
schedule: {
date: order.schedule?.date,
startTime: order.schedule?.startTime,
endTime: order.schedule?.endTime,
routeCode: order.schedule?.routeCode,
},
existingPromoCode: null,
referralCorrelationId: order.referralCorrelationId,
referralDate: order.referralDate,
@ -1615,6 +1649,9 @@ export const actions = {
return availableLineItems;
},
// Misc order actions
saveSchedule(context, scheduleInfo) {
context.commit(storeMutations.UPDATE_SCHEDULE, scheduleInfo);
},
saveServiceLocation(context, serviceLocationInfo) {
context.commit(storeMutations.UPDATE_SERVICE_LOCATION, serviceLocationInfo);
},