Merge pull request #959 from Safelite/rlsmerge/2023.01.19-to-develop
Rlsmerge/2023.01.19 to develop
This commit is contained in:
commit
7dbaec4096
3 changed files with 44 additions and 25 deletions
|
|
@ -44,7 +44,7 @@ export async function loadSessionIfPresent(isConceptInsurance) {
|
|||
funnelCookie.ReferralCorrelationId,
|
||||
isConceptInsurance
|
||||
)
|
||||
).data;
|
||||
)?.data;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -64,17 +64,14 @@ export default {
|
|||
};
|
||||
},
|
||||
getTierOnePackagePrice(lineItems) {
|
||||
let totalPrice = 0;
|
||||
lineItems.forEach((lineItem) => {
|
||||
const partType = lineItem.partType.toUpperCase();
|
||||
if (
|
||||
partType != partTypeStrings.FRONT_WIPER &&
|
||||
partType != partTypeStrings.REAR_WIPER &&
|
||||
partType != partTypeStrings.RAIN_DEFENSE
|
||||
) {
|
||||
totalPrice += this.getTotalLineItemPrice(lineItem);
|
||||
}
|
||||
let lineItemsToPrice = lineItems.filter((lineItem) => {
|
||||
return (
|
||||
lineItem.partType != partTypeStrings.FRONT_WIPER &&
|
||||
lineItem.partType != partTypeStrings.REAR_WIPER &&
|
||||
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
||||
);
|
||||
});
|
||||
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
||||
return totalPrice;
|
||||
},
|
||||
filterOutFees(lineItems) {
|
||||
|
|
@ -86,6 +83,18 @@ export default {
|
|||
});
|
||||
return filteredLineItems;
|
||||
},
|
||||
getTotalPriceOfAllLineItemsAndChildParts(lineItems) {
|
||||
let totalPrice = 0;
|
||||
lineItems.forEach((lineItem) => {
|
||||
totalPrice += this.getTotalLineItemPrice(lineItem);
|
||||
if (lineItem.childParts) {
|
||||
totalPrice += this.getTotalPriceOfAllLineItemsAndChildParts(
|
||||
lineItem.childParts
|
||||
);
|
||||
}
|
||||
});
|
||||
return totalPrice;
|
||||
},
|
||||
getTotalLineItemPrice(lineItem) {
|
||||
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { experimentTriggers } from "@/constants/experiments";
|
|||
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import router from "@/router";
|
||||
import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js";
|
||||
|
||||
// Export State
|
||||
const getDefaultState = () => {
|
||||
|
|
@ -1059,23 +1060,32 @@ export const actions = {
|
|||
referralCorrelationId: referralCorrelationId,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// Flatten location and name properties
|
||||
response.data.order.damage?.glassToReplace?.map((glass) => {
|
||||
glass.glassLocation = glass.location;
|
||||
glass.glassName = glass.name;
|
||||
delete glass.location;
|
||||
delete glass.name;
|
||||
return glass;
|
||||
});
|
||||
.then(
|
||||
(response) => {
|
||||
// Flatten location and name properties
|
||||
response.data.order.damage?.glassToReplace?.map((glass) => {
|
||||
glass.glassLocation = glass.location;
|
||||
glass.glassName = glass.name;
|
||||
delete glass.location;
|
||||
delete glass.name;
|
||||
return glass;
|
||||
});
|
||||
|
||||
// clear the state if the existing EON does not equal what is returned from loadSession
|
||||
if (context.state.order.eon && context.state.order.eon != response.data.eon) {
|
||||
// clear the state if the existing EON does not equal what is returned from loadSession
|
||||
if (context.state.order.eon && context.state.order.eon != response.data.eon) {
|
||||
context.commit(storeMutations.RESET_STATE);
|
||||
}
|
||||
context.commit(
|
||||
storeMutations.UPDATE_STATE_WITH_ORDER_INFORMATION,
|
||||
response.data
|
||||
);
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
deleteFunnelCookie();
|
||||
context.commit(storeMutations.RESET_STATE);
|
||||
}
|
||||
context.commit(storeMutations.UPDATE_STATE_WITH_ORDER_INFORMATION, response.data);
|
||||
return response;
|
||||
});
|
||||
);
|
||||
},
|
||||
|
||||
// Business domain actions
|
||||
|
|
|
|||
Loading…
Reference in a new issue