From 34327b77dbad375e66095a505a82a272228054d4 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 25 Jan 2024 10:52:10 -0500 Subject: [PATCH 1/9] base fix --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index f023bd708..8dfc989d4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -503,7 +503,7 @@ export const mutations = { state.order.lineItems.glassParts = sessionInformation.order.lineItems.glassParts; state.order.lineItems.supportingItems = sessionInformation.order.lineItems.supportingItems; - state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps; + state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps ?? []; state.order.lineItems.promos = sessionInformation.order.lineItems.promos; state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData; From 978f9c948d55e73cc63034c5f28c6a4b6f04b0cb Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 31 Jan 2024 13:50:04 -0500 Subject: [PATCH 2/9] Clip prices to 2 digits in logging. --- src/mixins/analytics-mixin.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index e0d865c35..c6a8033fb 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -155,10 +155,9 @@ export default { ...(lineItems.vaps ?? []), ...(lineItems.promos ?? []), ]; - const subtotal = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts( - combinedLineItems, - false - ); + const subtotal = baseMixin.methods + .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false) + .toFixed(2); // // get correct zip code const providerZip = order.serviceLocation.provider.address.zipCode; @@ -168,10 +167,9 @@ export default { : providerZip; // // calculate total - const total = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts( - combinedLineItems, - true - ); + const total = baseMixin.methods + .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, true) + .toFixed(2); const payload = { serviceZipCode: serviceZip, From f1e044549e4eeb967728463ee6143ae9b94b33c5 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 31 Jan 2024 14:58:18 -0500 Subject: [PATCH 3/9] Type coercion --- src/mixins/analytics-mixin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index c6a8033fb..d394190ff 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -176,16 +176,16 @@ export default { damageType: order.damage.isRepair ? "repair" : "replace", accountType: order.payment.isInsurance ? "insurance" : "cash", promoCodes: promoString, - vehicleYear: order.vehicle.year, + vehicleYear: `${order.vehicle.year}`, vehicleMake: order.vehicle.make, vehicleModel: order.vehicle.model, vehicleStyle: order.vehicle.style, glassToReplace: glassString, - workOrderId: order.workOrderId, - providerCtu: order.serviceLocation.zipCodeCtu, + workOrderId: parseInt(order.workOrderId), + providerCtu: parseInt(order.serviceLocation.zipCodeCtu), orderNumber: order.workOrderNumber, - priceTotal: total, - priceSubTotal: subtotal, + priceTotal: parseFloat(total), + priceSubTotal: parseFloat(subtotal), isRecalibrationOnOrder: store.getters.isRecalibrationOnSubmittedOrder, appointmentType: order.serviceLocation.appointmentType, }; From ac687e55454d448a9313cb3eb877c009d1d2453c Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 5 Feb 2024 20:40:23 +0530 Subject: [PATCH 4/9] CSR-1601 BillToAccountNumber --- src/constants/application-config.js | 1 + src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 1 + src/global-methods.js | 7 +++++-- src/layouts/payment-method/payment-method.vue | 4 ++-- .../promo-modal-question/promo-modal-question.vue | 4 ++-- src/layouts/payment/payment.vue | 2 +- src/layouts/quote/quote.vue | 5 +++++ src/store/index.js | 8 ++++++++ 9 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 244882509..b8a59a129 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -11,6 +11,7 @@ const applicationConfig = { PAGE_QUERYSTRING: "fmgPage", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", CASH_PARENT_ACCOUNT_NUMBER: 167132, + CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER: "87291", MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT, PIA_RESPONSE_URL: location.protocol + diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 9b6fdb865..d77237170 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -80,6 +80,7 @@ const storeActions = { SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PAYMENT_METHOD_CHOICE: "savePaymentMethodChoice", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", + SAVE_BILL_TO_ACCOUNT_NUMBER: "saveBillToAccountNumber", SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: "saveSupportingItemsSuppressingStateResetting", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 5b0b66509..0b0338fef 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -46,6 +46,7 @@ const storeMutations = { UPDATE_REFERRAL_DATE: "updateReferralDate", UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId", UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber", + UPDATE_BILL_TO_ACCT_NUMBER: "updateBillToAcctNumber", UPDATE_EON: "updateEON", UPDATE_IS_INSURANCE: "updateIsInsurance", UPDATE_SAVED_SESSION_ID: "updateSavedSessionId", diff --git a/src/global-methods.js b/src/global-methods.js index f2821343d..1d145476b 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -22,10 +22,13 @@ export default { const headers = { [headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings), }; - + const localhostserviceapi = "https://localhost:44317"; axios({ method: method, - url: cfDistroUrl + endpoint, + url: + (endpoint == "/schedule/api/v1/schedule/mobile-time-slots" + ? localhostserviceapi + : cfDistroUrl) + endpoint, data: payloadAndAnalyticsData, crossDomain: true, responseType: {}, diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 3bde800bf..75a8ffa0c 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -244,7 +244,7 @@ export default { const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { - billToAccountNumber: "87291", + billToAccountNumber: store.getters.payment.billToAccountNumber, providerNumber: store.getters.order.serviceLocation.provider.providerNumber, appointmentType: store.getters.order.serviceLocation.appointmentType, serviceLocationCity: store.getters.order.serviceLocation.city, @@ -405,7 +405,7 @@ export default { await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { - billToAccountNumber: "87291", + billToAccountNumber: store.getters.payment.billToAccountNumber, providerNumber: this.$store.getters.order.serviceLocation.provider.providerNumber, appointmentType: this.$store.getters.order.serviceLocation.appointmentType, diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index b4b02b3ed..9bd92cec3 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -255,14 +255,14 @@ export default { this.availableVaps, "payment-method" ); - + console.log(store.getters.payment.billToAccountNumber); if (promoCodeData.isValid) { const pricedLineItemsToTax = []; pricedLineItemsToTax.push(...promoCodeData.promoCode); const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { - billToAccountNumber: "87291", + billToAccountNumber: store.getters.payment.billToAccountNumber, providerNumber: store.getters.order.serviceLocation.provider.providerNumber, appointmentType: store.getters.order.serviceLocation.appointmentType, diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 365dccf01..a0f888b04 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -356,7 +356,7 @@ export default { const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { - billToAccountNumber: "87291", + billToAccountNumber: store.getters.payment.billToAccountNumber, providerNumber: store.getters.order.serviceLocation.provider.providerNumber, appointmentType: store.getters.order.serviceLocation.appointmentType, serviceLocationCity: store.getters.order.serviceLocation.city, diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 5c6b2d744..12ee04c8d 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -276,6 +276,11 @@ export default { applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, false ); + this.dispatchStoreAction( + this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, + applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER, + false + ); } if ( diff --git a/src/store/index.js b/src/store/index.js index 5339f7973..e900f2093 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -249,6 +249,9 @@ export const mutations = { updateParentAcctNumber(state, parentAcctNumber) { state.order.payment.parentAccountNumber = parentAcctNumber; }, + updateBillToAcctNumber(state, billToAcctNumber) { + state.order.payment.billToAccountNumber = billToAcctNumber; + }, updateEON(state, eon) { state.order.eon = eon; }, @@ -1484,6 +1487,7 @@ export const actions = { lineItems: lineItems, glassPieces: glassPieces, eon: order.eon, + billToAccountNumber: context.getters.payment.billToAccountNumber, coverage: { status: payment.insuranceCoverage.coverageStatus, deductible: order.policy.currentDeductible, @@ -1549,6 +1553,7 @@ export const actions = { lineItems: lineItems, glassPieces: glassPieces, eon: order.eon, + billToAccountNumber: context.getters.payment.billToAccountNumber, coverage: { status: payment.insuranceCoverage.coverageStatus, deductible: order.policy.currentDeductible, @@ -2123,6 +2128,9 @@ export const actions = { saveParentAccountNumber(context, parentAccountNumber) { context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber); }, + saveBillToAccountNumber(context, billToAccountNumber) { + context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber); + }, saveSupportingItems(context, supportingItems) { if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) { From 80044b34c7ac58d5659dea1ffe2031ff54970bda Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 5 Feb 2024 20:52:05 +0530 Subject: [PATCH 5/9] Update global-methods.js --- src/global-methods.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/global-methods.js b/src/global-methods.js index 1d145476b..6da8c0b33 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -22,13 +22,9 @@ export default { const headers = { [headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings), }; - const localhostserviceapi = "https://localhost:44317"; axios({ method: method, - url: - (endpoint == "/schedule/api/v1/schedule/mobile-time-slots" - ? localhostserviceapi - : cfDistroUrl) + endpoint, + url: cfDistroUrl + endpoint, data: payloadAndAnalyticsData, crossDomain: true, responseType: {}, From c644d3a7f8c556319481146a8cb009ecf8383201 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 5 Feb 2024 20:59:26 +0530 Subject: [PATCH 6/9] Revert "Update global-methods.js" --- src/global-methods.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/global-methods.js b/src/global-methods.js index 6da8c0b33..f2821343d 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -22,6 +22,7 @@ export default { const headers = { [headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings), }; + axios({ method: method, url: cfDistroUrl + endpoint, From ed447dd7630d169c6c9ef20f1803827f7bbb9af6 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 5 Feb 2024 21:15:53 +0530 Subject: [PATCH 7/9] Update promo-modal-question.vue --- .../payment-method/promo-modal-question/promo-modal-question.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index 9bd92cec3..adb9bee3d 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -255,7 +255,6 @@ export default { this.availableVaps, "payment-method" ); - console.log(store.getters.payment.billToAccountNumber); if (promoCodeData.isValid) { const pricedLineItemsToTax = []; pricedLineItemsToTax.push(...promoCodeData.promoCode); From 5b5417f4a935529ae12e0e2a48fad261c1e8c926 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 6 Feb 2024 09:43:25 -0500 Subject: [PATCH 8/9] CSR-1954 | Service-location continue button bug fix Mobile address was not always required to continue with "Mobile" option --- src/layouts/service-location/service-location.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 4e890e531..5dcbc76f4 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -152,12 +152,12 @@ const MOBILE_FEE_PART_TYPE = "MOBILE FEE"; // DEFINE VALIDATION RULES defineRule("mobile-location-required", (value) => { if ( - value.addressQuestions.streetAddress == "" || - value.addressQuestions.city == "" || - value.addressQuestions.state == "" || - value.addressQuestions.zipCode == "" || - value.isVehicleProtected == null - ) { + !value.addressQuestions.streetAddress || + !value.addressQuestions.city || + !value.addressQuestions.state || + !value.addressQuestions.zipCode || + !value.isVehicleProtected + ) { return errorMessages.MOBILE_LOCATION_REQUIRED; } return true; From 6cec4d316f49e860c0cf66c0a75aa0b4315ec090 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 6 Feb 2024 09:52:15 -0500 Subject: [PATCH 9/9] CSR-1954 | Formatting --- src/layouts/service-location/service-location.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 5dcbc76f4..6a43f456f 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -157,7 +157,7 @@ defineRule("mobile-location-required", (value) => { !value.addressQuestions.state || !value.addressQuestions.zipCode || !value.isVehicleProtected - ) { + ) { return errorMessages.MOBILE_LOCATION_REQUIRED; } return true;