CASH-462 | First look at order changes
This commit is contained in:
parent
9f22227655
commit
e894522acb
4 changed files with 53 additions and 49 deletions
|
|
@ -61,7 +61,7 @@ export default {
|
||||||
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||||
const order = hasSubmittedOrder ? submittedOrder : store.getters.order;
|
const order = hasSubmittedOrder ? submittedOrder.order : store.getters.order;
|
||||||
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "FixMyGlass" });
|
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "FixMyGlass" });
|
||||||
const headers = {
|
const headers = {
|
||||||
[headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings),
|
[headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings),
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export function getDisplayAmountDue(lineItemsObject, includeTax = true) {
|
||||||
export function getAmountDue(lineItemsObject, includeTax = true) {
|
export function getAmountDue(lineItemsObject, includeTax = true) {
|
||||||
let amountDue = 0;
|
let amountDue = 0;
|
||||||
const order = baseMixin?.methods?.hasSubmittedOrder()
|
const order = baseMixin?.methods?.hasSubmittedOrder()
|
||||||
? baseMixin?.methods?.getSubmittedOrder()
|
? baseMixin?.methods?.getSubmittedOrder().order
|
||||||
: store.getters.order;
|
: store.getters.order;
|
||||||
|
|
||||||
if (lineItemsObject?.glassParts) {
|
if (lineItemsObject?.glassParts) {
|
||||||
|
|
|
||||||
|
|
@ -173,8 +173,8 @@ export default {
|
||||||
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_WIPERS,
|
storeActions.GET_WIPERS,
|
||||||
{
|
{
|
||||||
serviceZipCode: submittedOrder.serviceLocation.zipCode,
|
serviceZipCode: submittedOrder.order.serviceLocation.zipCode,
|
||||||
carId: submittedOrder.vehicle.carId,
|
carId: submittedOrder.order.vehicle.carId,
|
||||||
},
|
},
|
||||||
"confirmation"
|
"confirmation"
|
||||||
);
|
);
|
||||||
|
|
@ -203,10 +203,10 @@ export default {
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
||||||
const lineItemsFromSubmittedOrder = deepClone(submittedOrder.lineItems);
|
const lineItemsFromSubmittedOrder = deepClone(submittedOrder.order.lineItems);
|
||||||
|
|
||||||
const isNoComp = submittedOrder?.policy?.isNoComp;
|
const isNoComp = submittedOrder?.order?.policy?.isNoComp;
|
||||||
const isItac = submittedOrder?.policy?.isItac;
|
const isItac = submittedOrder?.order?.policy?.isItac;
|
||||||
const isRecalibrationOnOrder = containsRecalParts(lineItemsFromSubmittedOrder);
|
const isRecalibrationOnOrder = containsRecalParts(lineItemsFromSubmittedOrder);
|
||||||
|
|
||||||
const shouldHideRecalibration = () => {
|
const shouldHideRecalibration = () => {
|
||||||
|
|
@ -254,7 +254,7 @@ export default {
|
||||||
return containsRecalParts(this?.lineItems);
|
return containsRecalParts(this?.lineItems);
|
||||||
},
|
},
|
||||||
ShowCart() {
|
ShowCart() {
|
||||||
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
if (this.isPia && this.submittedOrder?.order?.settledTenderAmount == 0) {
|
||||||
// settleTenderAmount always shows 0 via localhost or dev.
|
// settleTenderAmount always shows 0 via localhost or dev.
|
||||||
// Temporarily set return true to see cart in localhost or dev environment
|
// Temporarily set return true to see cart in localhost or dev environment
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -269,13 +269,13 @@ export default {
|
||||||
return this.getCmsContent("ScheduleConfirmationWidget", "Image");
|
return this.getCmsContent("ScheduleConfirmationWidget", "Image");
|
||||||
},
|
},
|
||||||
CustomerPortalLoginToken() {
|
CustomerPortalLoginToken() {
|
||||||
return this.submittedOrder?.customerPortalLoginToken;
|
return this.submittedOrder?.order.customerPortalLoginToken;
|
||||||
},
|
},
|
||||||
ConfirmationEmailText() {
|
ConfirmationEmailText() {
|
||||||
return this.getCmsContent("ConfirmationEmailWidget", "BodyText")
|
return this.getCmsContent("ConfirmationEmailWidget", "BodyText")
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.customer.emailAddress}",
|
"{custom:submittedOrder.customer.emailAddress}",
|
||||||
this.submittedOrder?.customer?.emailAddress
|
this.submittedOrder?.order.customer?.emailAddress
|
||||||
)
|
)
|
||||||
?.replaceAll("{custom:MY_ACCOUNT_URL}", applicationConfig.MY_ACCOUNT)
|
?.replaceAll("{custom:MY_ACCOUNT_URL}", applicationConfig.MY_ACCOUNT)
|
||||||
?.replaceAll("{custom:CUSTOMER_PORTAL_LOGIN_TOKEN}", this.CustomerPortalLoginToken)
|
?.replaceAll("{custom:CUSTOMER_PORTAL_LOGIN_TOKEN}", this.CustomerPortalLoginToken)
|
||||||
|
|
@ -283,88 +283,88 @@ export default {
|
||||||
?.replaceAll(">", ">");
|
?.replaceAll(">", ">");
|
||||||
},
|
},
|
||||||
ScheduleDate() {
|
ScheduleDate() {
|
||||||
return this.submittedOrder?.schedule?.date;
|
return this.submittedOrder?.order.schedule?.date;
|
||||||
},
|
},
|
||||||
AppointmentType() {
|
AppointmentType() {
|
||||||
return this.submittedOrder?.serviceLocation?.appointmentType;
|
return this.submittedOrder?.order.serviceLocation?.appointmentType;
|
||||||
},
|
},
|
||||||
ScheduleStartTime() {
|
ScheduleStartTime() {
|
||||||
return this.submittedOrder?.schedule?.startTime;
|
return this.submittedOrder?.order.schedule?.startTime;
|
||||||
},
|
},
|
||||||
ScheduleEndTime() {
|
ScheduleEndTime() {
|
||||||
return this.submittedOrder?.schedule?.endTime;
|
return this.submittedOrder?.order.schedule?.endTime;
|
||||||
},
|
},
|
||||||
InShopWordingText() {
|
InShopWordingText() {
|
||||||
return this.getCmsContent("InShopWordingWidget", "BodyText")
|
return this.getCmsContent("InShopWordingWidget", "BodyText")
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.year}",
|
"{custom:submittedOrder.vehicle.year}",
|
||||||
this.submittedOrder?.vehicle?.year
|
this.submittedOrder?.order?.vehicle?.year
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.make}",
|
"{custom:submittedOrder.vehicle.make}",
|
||||||
this.submittedOrder?.vehicle?.make
|
this.submittedOrder?.order?.vehicle?.make
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.model}",
|
"{custom:submittedOrder.vehicle.model}",
|
||||||
this.submittedOrder?.vehicle?.model
|
this.submittedOrder?.order?.vehicle?.model
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
MobileWordingText() {
|
MobileWordingText() {
|
||||||
return this.getCmsContent("MobileWordingWidget", "BodyText")
|
return this.getCmsContent("MobileWordingWidget", "BodyText")
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.year}",
|
"{custom:submittedOrder.vehicle.year}",
|
||||||
this.submittedOrder?.vehicle?.year
|
this.submittedOrder?.order?.vehicle?.year
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.make}",
|
"{custom:submittedOrder.vehicle.make}",
|
||||||
this.submittedOrder?.vehicle?.make
|
this.submittedOrder?.order?.vehicle?.make
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.model}",
|
"{custom:submittedOrder.vehicle.model}",
|
||||||
this.submittedOrder?.vehicle?.model
|
this.submittedOrder?.order?.vehicle?.model
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
DropOffWordingText() {
|
DropOffWordingText() {
|
||||||
return this.getCmsContent("DropOffWordingWidget", "BodyText")
|
return this.getCmsContent("DropOffWordingWidget", "BodyText")
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.year}",
|
"{custom:submittedOrder.vehicle.year}",
|
||||||
this.submittedOrder?.vehicle?.year
|
this.submittedOrder?.order?.vehicle?.year
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.make}",
|
"{custom:submittedOrder.vehicle.make}",
|
||||||
this.submittedOrder?.vehicle?.make
|
this.submittedOrder?.order?.vehicle?.make
|
||||||
)
|
)
|
||||||
?.replaceAll(
|
?.replaceAll(
|
||||||
"{custom:submittedOrder.vehicle.model}",
|
"{custom:submittedOrder.vehicle.model}",
|
||||||
this.submittedOrder?.vehicle?.model
|
this.submittedOrder?.order?.vehicle?.model
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
ServiceLocationAddress() {
|
ServiceLocationAddress() {
|
||||||
return this.submittedOrder?.serviceLocation?.address;
|
return this.submittedOrder?.order?.serviceLocation?.address;
|
||||||
},
|
},
|
||||||
ServiceLocationAddress2() {
|
ServiceLocationAddress2() {
|
||||||
return this.submittedOrder?.serviceLocation?.address2;
|
return this.submittedOrder?.order?.serviceLocation?.address2;
|
||||||
},
|
},
|
||||||
ServiceLocationCity() {
|
ServiceLocationCity() {
|
||||||
return this.submittedOrder?.serviceLocation?.city;
|
return this.submittedOrder?.order?.serviceLocation?.city;
|
||||||
},
|
},
|
||||||
ServiceLocationState() {
|
ServiceLocationState() {
|
||||||
return this.submittedOrder?.serviceLocation?.state;
|
return this.submittedOrder?.order?.serviceLocation?.state;
|
||||||
},
|
},
|
||||||
ServiceLocationZipCode() {
|
ServiceLocationZipCode() {
|
||||||
return this.submittedOrder?.serviceLocation?.zipCode;
|
return this.submittedOrder?.order?.serviceLocation?.zipCode;
|
||||||
},
|
},
|
||||||
ProviderAddress() {
|
ProviderAddress() {
|
||||||
return this.submittedOrder?.serviceLocation?.provider?.address?.streetAddress;
|
return this.submittedOrder?.order?.serviceLocation?.provider?.address?.streetAddress;
|
||||||
},
|
},
|
||||||
ProviderCity() {
|
ProviderCity() {
|
||||||
return this.submittedOrder?.serviceLocation?.provider?.address?.city;
|
return this.submittedOrder?.order?.serviceLocation?.provider?.address?.city;
|
||||||
},
|
},
|
||||||
ProviderState() {
|
ProviderState() {
|
||||||
return this.submittedOrder?.serviceLocation?.provider?.address?.state;
|
return this.submittedOrder?.order?.serviceLocation?.provider?.address?.state;
|
||||||
},
|
},
|
||||||
ProviderZipCode() {
|
ProviderZipCode() {
|
||||||
return this.submittedOrder?.serviceLocation?.provider?.address?.zipCode;
|
return this.submittedOrder?.order?.serviceLocation?.provider?.address?.zipCode;
|
||||||
},
|
},
|
||||||
AppointmentWordingText() {
|
AppointmentWordingText() {
|
||||||
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
|
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
|
||||||
|
|
@ -408,7 +408,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
|
if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
|
||||||
if (
|
if (
|
||||||
this.submittedOrder?.schedule?.routeCode.includes(
|
this.submittedOrder?.order?.schedule?.routeCode.includes(
|
||||||
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|
@ -420,22 +420,22 @@ export default {
|
||||||
return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`;
|
return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`;
|
||||||
},
|
},
|
||||||
vehicleBannerImageUrl() {
|
vehicleBannerImageUrl() {
|
||||||
return this.submittedOrder?.vehicle.imageUrl;
|
return this.submittedOrder?.order?.vehicle.imageUrl;
|
||||||
},
|
},
|
||||||
damageInfo() {
|
damageInfo() {
|
||||||
return this.submittedOrder?.damage;
|
return this.submittedOrder?.order?.damage;
|
||||||
},
|
},
|
||||||
isMSRFeeApplicable() {
|
isMSRFeeApplicable() {
|
||||||
return this.submittedOrder?.isMSRFeeApplicable;
|
return this.submittedOrder?.order?.isMSRFeeApplicable;
|
||||||
},
|
},
|
||||||
isInsurance() {
|
isInsurance() {
|
||||||
return this.submittedOrder?.payment?.isInsurance;
|
return this.submittedOrder?.order?.payment?.isInsurance;
|
||||||
},
|
},
|
||||||
isNoComp() {
|
isNoComp() {
|
||||||
return this.submittedOrder?.policy?.isNoComp;
|
return this.submittedOrder?.order?.policy?.isNoComp;
|
||||||
},
|
},
|
||||||
isItac() {
|
isItac() {
|
||||||
return this.submittedOrder?.policy?.isItac;
|
return this.submittedOrder?.order?.policy?.isItac;
|
||||||
},
|
},
|
||||||
hasVapsInCart() {
|
hasVapsInCart() {
|
||||||
if (this.lineItems?.vaps?.length > 0) {
|
if (this.lineItems?.vaps?.length > 0) {
|
||||||
|
|
@ -448,28 +448,28 @@ export default {
|
||||||
if (this.isNoComp || this.isItac) {
|
if (this.isNoComp || this.isItac) {
|
||||||
return coverageStatus.NOCOMP;
|
return coverageStatus.NOCOMP;
|
||||||
} else {
|
} else {
|
||||||
return this.submittedOrder?.payment?.insuranceCoverage?.coverageStatus;
|
return this.submittedOrder?.order?.payment?.insuranceCoverage?.coverageStatus;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
currentDeductible() {
|
currentDeductible() {
|
||||||
return this.submittedOrder?.policy?.currentDeductible;
|
return this.submittedOrder?.order?.policy?.currentDeductible;
|
||||||
},
|
},
|
||||||
insuranceCompanyName() {
|
insuranceCompanyName() {
|
||||||
return this.submittedOrder?.policy?.insuranceCompanyName;
|
return this.submittedOrder?.order?.policy?.insuranceCompanyName;
|
||||||
},
|
},
|
||||||
isPia() {
|
isPia() {
|
||||||
return this.submittedOrder?.payment?.isPia;
|
return this.submittedOrder?.order?.payment?.isPia;
|
||||||
},
|
},
|
||||||
AppointmentDuration() {
|
AppointmentDuration() {
|
||||||
const durationMaximum = this.submittedOrder?.schedule?.jobMaxMinutes;
|
const durationMaximum = this.submittedOrder?.order?.schedule?.jobMaxMinutes;
|
||||||
const durationMinimum = this.submittedOrder?.schedule?.jobMinMinutes;
|
const durationMinimum = this.submittedOrder?.order?.schedule?.jobMinMinutes;
|
||||||
const durationLengthString = "Duration: ";
|
const durationLengthString = "Duration: ";
|
||||||
if (
|
if (
|
||||||
this.submittedOrder?.schedule?.routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)
|
this.submittedOrder?.order?.schedule?.routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)
|
||||||
) {
|
) {
|
||||||
return durationLengthString.concat("All Day");
|
return durationLengthString.concat("All Day");
|
||||||
} else if (
|
} else if (
|
||||||
this.submittedOrder?.schedule?.routeCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
|
this.submittedOrder?.order?.schedule?.routeCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
|
||||||
) {
|
) {
|
||||||
return durationLengthString.concat("Overnight");
|
return durationLengthString.concat("Overnight");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -541,7 +541,7 @@ export default {
|
||||||
parseInt(this.donationAmount),
|
parseInt(this.donationAmount),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
this.lineItems = deepClone(this.getSubmittedOrder().lineItems);
|
this.lineItems = deepClone(this.getSubmittedOrder().order.lineItems);
|
||||||
} else {
|
} else {
|
||||||
this.showDonationError = true;
|
this.showDonationError = true;
|
||||||
this.showDonationSuccess = false;
|
this.showDonationSuccess = false;
|
||||||
|
|
|
||||||
|
|
@ -1854,6 +1854,7 @@ export const actions = {
|
||||||
if (windshieldPartWithRecal) {
|
if (windshieldPartWithRecal) {
|
||||||
url += `/${windshieldPartWithRecal.partNumber}`;
|
url += `/${windshieldPartWithRecal.partNumber}`;
|
||||||
}
|
}
|
||||||
|
url += "/false";
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetProviders.method,
|
method: endpoints.GetProviders.method,
|
||||||
|
|
@ -3263,7 +3264,10 @@ export const actions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a submitted order object from vuex.
|
// create a submitted order object from vuex.
|
||||||
const submittedOrder = context.state.order;
|
const submittedOrder = {
|
||||||
|
order: context.state.order,
|
||||||
|
applicationUser: context.state.applicationUser,
|
||||||
|
};
|
||||||
|
|
||||||
const experiments = context.state.applicationUser.experiments;
|
const experiments = context.state.applicationUser.experiments;
|
||||||
const affiliateCookies = context.state.applicationUser.affiliateCookies;
|
const affiliateCookies = context.state.applicationUser.affiliateCookies;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue