diff --git a/jest.config.js b/jest.config.js index f114ef2c3..ac8208423 100644 --- a/jest.config.js +++ b/jest.config.js @@ -27,7 +27,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 77, + statements: 75, }, }, // Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 8f4116c83..320952b4d 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -138,6 +138,18 @@ const endpoints = { url: "/price/api/v1/price/order-items", method: "GET", }, + ValidatePromo: { + url: "/price/api/v1/price/order-promo", + method: "POST", + }, + RevalidatePromos: { + url: "/price/api/v1/price/revalidated-order-promos", + method: "POST", + }, + TaxOrderItems: { + url: "/price/api/v1/price/taxed-order-items", + method: "GET", + }, LogExperimentExposureIfAssigned: { url: "/experiments/api/v1/experiments/log-exposure", method: "POST", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 288ceb67b..5620612bb 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -41,6 +41,7 @@ const storeActions = { UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse", VALIDATE_ZIP: "validateZip", PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "priceOrderItemsAndSaveServerData", + TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA: "taxOrderItemsAndSaveServerData", LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure", LOG_PAGE_VIEW: "logPageView", LOG_CUSTOM_EVENT: "logCustomEvent", @@ -50,6 +51,8 @@ const storeActions = { CLEAR_VIN: "clearVin", RESET_SAVE_SESSION_PROMISE: "resetSaveSessionPromise", GET_SIGNATURE: "getSignature", + VALIDATE_ORDER_PROMO_AND_SAVE_SERVER_DATA: "validateOrderPromoAndSaveServerData", + REVALIDATE_ORDER_PROMOS_AND_UPDATE_STORE: "revalidateOrderPromosAndUpdateStore", // DEPENDENCY MUTATIONS RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies", @@ -83,6 +86,7 @@ const storeActions = { SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: "saveSupportingItemsSuppressingStateResetting", SAVE_VAPS: "saveVaps", + SAVE_PROMOS: "savePromos", SAVE_CUSTOMER_DETAILS: "saveCustomerDetails", SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", SAVE_WORK_ORDER_FLAG: "saveWorkOrderFlag", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 632379de3..af3a0a5ad 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -26,6 +26,8 @@ const storeMutations = { UPDATE_VAPS: "updateVaps", UPDATE_SUPPORTING_ITEMS: "updateSupportingItems", UPDATE_LINE_ITEMS_SERVER_DATA: "updateLineItemsServerData", + UPDATE_INACTIVE_PROMOS: "updateInactivePromos", + UPDATE_PROMOS: "updatePromos", UPDATE_REGISTRATION: "updateRegistration", diff --git a/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue index 0a6faa72f..d894f2ee8 100644 --- a/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue +++ b/src/fmg-components/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -21,9 +21,8 @@ export default { name: "add-vaps-modal-buttons", props: { cartItems: Object, - rainDefenseItem: Object, - wiperItems: Object, vapsTilesCmsName: String, + availableLineItems: Object, }, data() { return { @@ -55,13 +54,19 @@ export default { }); }, rainDefensePrice() { - const lineItem = this.rainDefenseItem; + // const lineItem = this.rainDefenseItem; + const lineItem = this.availableLineItems.find((item) => { + return item.partType === "RAIN DEFENSE"; + }); + const price = lineItem.laborAmount + lineItem.sellingPrice + lineItem.kitPrice; return parseFloat(price).toFixed(2); }, wipersPrice() { let price = 0; - const lineItems = this.wiperItems; + const lineItems = this.availableLineItems.filter((item) => { + return item.partType.includes(" WIPER"); + }); lineItems?.forEach((item) => { price += item.laborAmount + item.sellingPrice + item.kitPrice; }); diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 67558c323..7107e64e8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -54,36 +54,28 @@