From 3cbddd8cda0741951d17b5da0c5e46a228cc0aba Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 9 Jan 2026 10:58:04 -0500 Subject: [PATCH] CASH-2025: updates to store actions --- src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 1 + src/store/index.js | 13 +++++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index e09a4c78b..2fc0c88eb 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -111,6 +111,7 @@ const storeActions = { SAVE_PAYPAL_TOKEN: "savePaypalToken", SAVE_NEXTGEN_SETTLED_AMOUNT: "saveNextGenSettledAmount", SAVE_IS_RECAL_ACK_OPT_IN: "saveIsRecalAckOptIn", + SAVE_IS_OEM_GLASS_SELECTED: "saveIsOemGlassSelected", SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable", CREATE_SUBMITTED_STATE: "createSubmittedState", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 2112c789c..5167581e0 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -69,6 +69,7 @@ const storeMutations = { LOCK_TOKEN: "updateLockToken", UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount", UPDATE_IS_RECAL_ACK_OPT_IN: "updateIsRecalAckOptIn", + UPDATE_IS_OEM_GLASS_SELECTED: "updateIsOemGlassSelected", UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable", UPDATE_CASH_PRICE_SUBTOTAL: "updateCashPriceSubTotal", diff --git a/src/store/index.js b/src/store/index.js index 1c1f4038f..8dd6d7502 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -190,6 +190,7 @@ const getDefaultState = () => { settledTenderAmount: 0, isRecalAckOptIn: false, isMSRFeeApplicable: false, + isOemGlassSelected: false, }, applicationUser: { eventBus: [], @@ -342,6 +343,9 @@ export const mutations = { updateIsRecalAckOptIn(state, isRecalAckOptIn) { state.order.isRecalAckOptIn = isRecalAckOptIn; }, + updateIsOemGlassSelected(state, isOemGlassSelected) { + state.order.isOemGlassSelected = isOemGlassSelected; + }, updateIsMSRFeeApplicable(state, isMSRFeeApplicable) { state.order.isMSRFeeApplicable = isMSRFeeApplicable; }, @@ -674,6 +678,7 @@ export const mutations = { state.order.eon = sessionInformation.order.eon; state.order.customerPortalLoginToken = sessionInformation.order.CustomerPortalLoginToken; state.order.isRecalAckOptIn = sessionInformation.order.isRecalAckOptIn; + state.order.isOemGlassSelected = sessionInformation.order.isOemGlassSelected; if (state.order.vehicle.vin !== sessionInformation.order.vehicle?.vin) { state.applicationUser.pageData[routeData.PART_QUESTIONS.name] = null; @@ -1853,8 +1858,7 @@ export const actions = { const serviceType = order.serviceLocation?.appointmentType; const referralSeqNumber = order.referralSequenceNumber; const parentAccountNumber = applicationConfig.CASH_PARENT_ACCOUNT_NUMBER; - const oemEndorsementFlag = false; // Need to update from the store when available - + const oemEndorsementFlag = order.isOemGlassSelected; // create a new array to avoid mutating state const glassArrayForPayload = convertGlassPieceNamingForApi(glassArray); const resultsArrayForPayload = convertResultsForApi(resultsArray); @@ -2542,6 +2546,7 @@ export const actions = { lockToken: order.lockToken, isRecalAckOptIn: order.isRecalAckOptIn, isMSRFeeApplicable: order.isMSRFeeApplicable, + isOemGlassSelected: order.isOemGlassSelected, cashPriceSubTotal: order.cashPriceSubTotal, }, }, @@ -2959,6 +2964,10 @@ export const actions = { context.commit(storeMutations.UPDATE_IS_RECAL_ACK_OPT_IN, isRecalAckOptIn); }, + saveIsOemGlassSelected(context, isOemGlassSelected) { + context.commit(storeMutations.UPDATE_IS_OEM_GLASS_SELECTED, isOemGlassSelected); + }, + saveIsMSRFeeApplicable(context, isMSRFeeApplicable) { context.commit(storeMutations.UPDATE_IS_MSR_FEE_APPLICABLE, isMSRFeeApplicable); },