Do not assign service type and schedule details from load session once user make selection. it is overriding user selection.
This commit is contained in:
hiteshkumar87 2025-02-05 16:45:50 +05:30
parent a7a901d8da
commit d92cb225c2

View file

@ -49,6 +49,7 @@ import {
import { externalParameterStatus } from "@/constants/external-parameters";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import { Store } from "vuex/dist/vuex.cjs.js";
// Export State
const getDefaultState = () => {
@ -678,34 +679,38 @@ export const mutations = {
sessionInformation.order.payment.billToAccountNumber;
state.order.payment.inactivePromos = sessionInformation.order.payment.inactivePromos;
state.order.serviceLocation.address =
sessionInformation.order.serviceLocation.streetAddress;
state.order.serviceLocation.address2 =
sessionInformation.order.serviceLocation.streetAddress2;
state.order.serviceLocation.city = sessionInformation.order.serviceLocation.city;
state.order.serviceLocation.state = sessionInformation.order.serviceLocation.state;
state.order.serviceLocation.zipCode = sessionInformation.order.serviceLocation.zipCode;
state.order.serviceLocation.zipCodeCtu =
sessionInformation.order.serviceLocation.zipCodeCtu;
//Do not assign default service type once user make service type selection
if (state.order.serviceLocation.appointmentType == null) {
state.order.serviceLocation.address =
sessionInformation.order.serviceLocation.streetAddress;
state.order.serviceLocation.address2 =
sessionInformation.order.serviceLocation.streetAddress2;
state.order.serviceLocation.city = sessionInformation.order.serviceLocation.city;
state.order.serviceLocation.state = sessionInformation.order.serviceLocation.state;
state.order.serviceLocation.zipCode = sessionInformation.order.serviceLocation.zipCode;
state.order.serviceLocation.zipCodeCtu =
sessionInformation.order.serviceLocation.zipCodeCtu;
state.order.serviceLocation.appointmentType =
sessionInformation.order.serviceLocation.appointmentType;
state.order.serviceLocation.isVehicleProtected =
sessionInformation.order.serviceLocation.isVehicleProtected;
state.order.serviceLocation.appointmentType =
sessionInformation.order.serviceLocation.appointmentType;
state.order.serviceLocation.isVehicleProtected =
sessionInformation.order.serviceLocation.isVehicleProtected;
state.order.serviceLocation.provider.providerNumber =
sessionInformation.order.serviceLocation.provider?.providerNumber;
state.order.serviceLocation.provider.address.streetAddress =
sessionInformation.order.serviceLocation.provider?.address?.streetAddress;
state.order.serviceLocation.provider.address.city =
sessionInformation.order.serviceLocation.provider?.address?.city;
state.order.serviceLocation.provider.address.state =
sessionInformation.order.serviceLocation.provider?.address?.state;
state.order.serviceLocation.provider.address.zipCode =
sessionInformation.order.serviceLocation.provider?.address?.zipCode;
state.order.serviceLocation.provider.address.zipCodeCtu =
sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu;
state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes;
state.order.serviceLocation.provider.providerNumber =
sessionInformation.order.serviceLocation.provider?.providerNumber;
state.order.serviceLocation.provider.address.streetAddress =
sessionInformation.order.serviceLocation.provider?.address?.streetAddress;
state.order.serviceLocation.provider.address.city =
sessionInformation.order.serviceLocation.provider?.address?.city;
state.order.serviceLocation.provider.address.state =
sessionInformation.order.serviceLocation.provider?.address?.state;
state.order.serviceLocation.provider.address.zipCode =
sessionInformation.order.serviceLocation.provider?.address?.zipCode;
state.order.serviceLocation.provider.address.zipCodeCtu =
sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu;
state.order.serviceLocation.techNotes =
sessionInformation.order.serviceLocation.techNotes;
}
// if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that
// a service package is not selected by default on the quote page.
@ -749,14 +754,15 @@ export const mutations = {
state.applicationUser.savedSessionId =
sessionInformation.applicationUser.savedSessionId;
}
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;
state.order.schedule.jobMaxMinutes = sessionInformation.order.schedule?.jobMaxMinutes;
state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes;
//Do not assign default schedule details once user make schedule selection
if (state.order.schedule.date == null) {
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;
state.order.schedule.jobMaxMinutes = sessionInformation.order.schedule?.jobMaxMinutes;
state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes;
}
state.order.policy.currentDeductible = sessionInformation.order.policy?.currentDeductible;
state.order.policy.originalDeductible = sessionInformation.order.policy?.originalDeductible;
state.order.policy.additionalAuthFlag = sessionInformation.order.policy?.additionalAuthFlag;
@ -2254,7 +2260,7 @@ export const actions = {
response.data
);
await resetScheduleIfUnavailable(context, response.data.order, pageNameToLog);
await resetScheduleIfUnavailable(context, context.state.order, pageNameToLog);
return response;
},
(error) => {
@ -3042,7 +3048,10 @@ export const actions = {
},
savePhoneNumber(context, phoneNumber) {
context.commit(storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, phoneNumber === "" ? null : phoneNumber);
context.commit(
storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER,
phoneNumber === "" ? null : phoneNumber
);
},
saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) {