From 401eb1649606184c8eaa6f6daf94d5238ae07ff4 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 30 Mar 2026 09:56:33 -0400 Subject: [PATCH 1/6] INSR-9042: Add apple-developer-merchantid-domain-association for Adyen --- azure-pipelines.yml | 15 +++++++++++++++ .../apple-developer-merchantid-domain-association | 1 + 2 files changed, 16 insertions(+) create mode 100644 public/apple-pay/non-prod/apple-developer-merchantid-domain-association diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b2134181..f21dde96 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -244,6 +244,11 @@ stages: Contents: '**' TargetFolder: 'public/.well-known' CleanTargetFolder: true + - task: CopyFiles@2 + inputs: + SourceFolder: 'public/apple-pay/non-prod' + Contents: '**' + TargetFolder: 'public/.well-known' - task: DeleteFiles@1 inputs: SourceFolder: 'public/apple-pay' @@ -309,6 +314,11 @@ stages: Contents: '**' TargetFolder: 'public/.well-known' CleanTargetFolder: true + - task: CopyFiles@2 + inputs: + SourceFolder: 'public/apple-pay/non-prod' + Contents: '**' + TargetFolder: 'public/.well-known' - task: DeleteFiles@1 inputs: SourceFolder: 'public/apple-pay' @@ -374,6 +384,11 @@ stages: Contents: '**' TargetFolder: 'public/.well-known' CleanTargetFolder: true + - task: CopyFiles@2 + inputs: + SourceFolder: 'public/apple-pay/non-prod' + Contents: '**' + TargetFolder: 'public/.well-known' - task: DeleteFiles@1 inputs: SourceFolder: 'public/apple-pay' diff --git a/public/apple-pay/non-prod/apple-developer-merchantid-domain-association b/public/apple-pay/non-prod/apple-developer-merchantid-domain-association new file mode 100644 index 00000000..06a25bc8 --- /dev/null +++ b/public/apple-pay/non-prod/apple-developer-merchantid-domain-association @@ -0,0 +1 @@ +7B227073704964223A2236304337424642364544314638313934464532303338324430433546453643423146433836313133344643433343333338303042463334303446414635454546222C2276657273696F6E223A312C22637265617465644F6E223A313731353230333539303839352C227369676E6174757265223A223330383030363039326138363438383666373064303130373032613038303330383030323031303133313064333030623036303936303836343830313635303330343032303133303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038313636333463386230653330353731373330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433323334333033343332333933313337333433373332333735613137306433323339333033343332333833313337333433373332333635613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306336663032336362323631346262333033383838613136323938336531613933663130353666353066613738636462396261346361323431636331346532356530323231303062653363643064666431363234376636343934343735333830653964343463323238613130383930613361316463373234623862346362383838393831386263333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031383833303832303138343032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383136363334633862306533303537313733303062303630393630383634383031363530333034303230316130383139333330313830363039326138363438383666373064303130393033333130623036303932613836343838366637306430313037303133303163303630393261383634383836663730643031303930353331306631373064333233343330333533303338333233313332333633333330356133303238303630393261383634383836663730643031303933343331316233303139333030623036303936303836343830313635303330343032303161313061303630383261383634386365336430343033303233303266303630393261383634383836663730643031303930343331323230343230623231633335366532323037626639343466366163366362616331366630326162346130323539613334626436366338336464376364633736616464353336663330306130363038326138363438636533643034303330323034343733303435303232303132346264343939323464373533643835643233363066316635616165306230653765343263346237326166613766306263313032616539316365613930613830323231303062353061343036396433366632326634333265303061666665636136663364626265633633633666396133346231353838323436643634363032313332363636303030303030303030303030227D \ No newline at end of file From 247237ba4825eabc7442ba09ad59c1c364abff1d Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 31 Mar 2026 13:09:10 -0400 Subject: [PATCH 2/6] updates for mobile first popup --- src/constants/experiments.js | 11 ++++++++++- src/helpers/service-location-helper.js | 15 +++++++++++++++ src/layouts/schedule-page/schedule-page.vue | 18 ++++++++++++++---- src/mixins/experiment-mixin.js | 10 ++++++++++ src/store/index.js | 3 +-- 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index c336503b..1c0edd15 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -19,9 +19,18 @@ const experimentSettings = Object.freeze({ ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1' }); +const experimentTest = Object.freeze({ + ISS_MOBILE_FIRST_POPUP_V3: 'ISS_Mobile_First_Popup_V3' +}); + +const experimentVariation = Object.freeze({ + ISS_MOBILE_FIRST_CONTROL_V3: 'NoShowMobileFirstPopUp_V3_CONTROL', + ISS_MOBILE_FIRST_TEST_V3: 'YesShowMobileFirstPopUp_V3_TEST' +}); + const experimentTriggers = Object.freeze({ SITE_ENTRY: 'SiteEntry', PAGE_ENTRY: 'PageEntry' }); -export { experimentUniverses, experimentSettings, experimentTriggers }; +export { experimentUniverses, experimentSettings, experimentTest, experimentVariation, experimentTriggers }; diff --git a/src/helpers/service-location-helper.js b/src/helpers/service-location-helper.js index 13aced81..12fc8589 100644 --- a/src/helpers/service-location-helper.js +++ b/src/helpers/service-location-helper.js @@ -73,6 +73,21 @@ export async function getZipCodeData(zipCode) { return await processZipCodeResults(useMainStore().validateZip({ zip: zipCode })); } +export function isServicableMobileWithData(isGlassServiceableMobile, isRecalibrationServiceableMobile) { + const isBigTruck = useMainStore().order.serviceLocation.isBigTruck; + if (isBigTruck) { + return false; + } + + if (isRecalibrationServiceableMobile !== null) { + return ( + isGlassServiceableMobile + && isRecalibrationServiceableMobile + ); + } + return !!isGlassServiceableMobile; +} + export function mapTimeSlot(timeSlot, timeOfDay) { return { ...timeSlot, diff --git a/src/layouts/schedule-page/schedule-page.vue b/src/layouts/schedule-page/schedule-page.vue index f0b1a150..8fb784ed 100644 --- a/src/layouts/schedule-page/schedule-page.vue +++ b/src/layouts/schedule-page/schedule-page.vue @@ -77,7 +77,7 @@ import siteFooter from '@/iss-components/site-footer/site-footer.vue'; import suggestTimeslotModal from '@/layouts/schedule-page/suggest-timeslot-modal/suggest-timeslot-modal.vue'; // Supporting files -import { experimentSettings, experimentUniverses } from '@/constants/experiments'; +import { experimentSettings, experimentTest, experimentVariation, experimentUniverses } from '@/constants/experiments'; import { AppointmentTypeStrings, GET_MOBILE_TIME_SLOTS, @@ -99,6 +99,7 @@ import { getPricedMobileFeePart, getMobileZipCodeData, getZipCodeData, + isServicableMobileWithData, mapTimeSlot } from '@/helpers/service-location-helper'; import { Form } from 'vee-validate'; @@ -337,7 +338,7 @@ export default { mobileProviderNumber: resultMap.providers?.mobileProviderNumber, serviceabilityDetails: resultMap.serviceabilityDetails, zipCode: initialServiceLocationObj.zipCode - } + }; vm.setCmsContent(resultMap.cmsContent); vm.$refs.serviceLocation.initializeComponent(serviceLocationData); @@ -492,12 +493,17 @@ export default { ); }, async checkMobileFirstExperience(mobileFirstObject = {}) { + const mobileFirstExperimentVariation = this.getExperimentVariationNameByTestName(experimentTest.ISS_MOBILE_FIRST_POPUP_V3); + const isMobileFirstTestVariation = mobileFirstExperimentVariation === experimentVariation.ISS_MOBILE_FIRST_TEST_V3; const showMobileFirst = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT); if (showMobileFirst) { const pmMobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS); const mobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_MOBILE_DAYS); const hasSelectedDate = !!this.getSelectedDate(); - const isServicableMobile = mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile; + const isServicableMobile = isServicableMobileWithData( + mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile, + mobileFirstObject.serviceabilityDetails?.isRecalibrationServiceableMobile + ); if (!hasSelectedDate && isServicableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) { const todayDateObject = new Date(); const todayDateString = convertDateToDateString(todayDateObject); @@ -624,7 +630,11 @@ export default { this.mainStore.logMobileFirstExperimentExposure(); } - this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile); + if (isMobileFirstTestVariation) { + this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile); + } else { + console.log('In Control group or experiment not found, skip showing popup'); + } } } } diff --git a/src/mixins/experiment-mixin.js b/src/mixins/experiment-mixin.js index 7f9a761e..6668722b 100644 --- a/src/mixins/experiment-mixin.js +++ b/src/mixins/experiment-mixin.js @@ -12,6 +12,16 @@ export default { const experiment = useMainStore().applicationUser.experiments.find((e) => e.universeName === experimentName); return experiment ? experiment : null; }, + getExperimentByTestName(testName) { + return useMainStore().applicationUser.experiments.find((experiment) => experiment.testName === testName); + }, + getExperimentVariationNameByTestName(testName) { + const experimentByTestName = this.getExperimentByTestName(testName); + if (!experimentByTestName) { + return null; + } + return experimentByTestName.variationName; + }, getSettingValue(settingName) { return this.hasSetting(settingName) ? useMainStore().experimentSettings[settingName] diff --git a/src/store/index.js b/src/store/index.js index 5b5b2f57..f3b21047 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2795,7 +2795,6 @@ export const useMainStore = defineStore({ ); }, - updateContactInfo(contactInfo) { this.order.customer.firstName = contactInfo?.firstName ?? this.order.customer.firstName; this.order.customer.lastName = contactInfo?.lastName ?? this.order.customer.lastName; @@ -3087,7 +3086,7 @@ export const useMainStore = defineStore({ }); return response.data; }, - + hasSubmittedOrder() { return window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER) !== null; }, From b6402788334a23a251d5fe227fe94190ae041b5a Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 31 Mar 2026 13:31:36 -0400 Subject: [PATCH 3/6] copilot updates --- src/helpers/service-location-helper.js | 2 +- src/layouts/schedule-page/schedule-page.vue | 10 +++++----- src/mixins/experiment-mixin.js | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/helpers/service-location-helper.js b/src/helpers/service-location-helper.js index 12fc8589..2c074a3a 100644 --- a/src/helpers/service-location-helper.js +++ b/src/helpers/service-location-helper.js @@ -73,7 +73,7 @@ export async function getZipCodeData(zipCode) { return await processZipCodeResults(useMainStore().validateZip({ zip: zipCode })); } -export function isServicableMobileWithData(isGlassServiceableMobile, isRecalibrationServiceableMobile) { +export function isServiceableMobileWithData(isGlassServiceableMobile, isRecalibrationServiceableMobile) { const isBigTruck = useMainStore().order.serviceLocation.isBigTruck; if (isBigTruck) { return false; diff --git a/src/layouts/schedule-page/schedule-page.vue b/src/layouts/schedule-page/schedule-page.vue index 8fb784ed..2e65643b 100644 --- a/src/layouts/schedule-page/schedule-page.vue +++ b/src/layouts/schedule-page/schedule-page.vue @@ -99,7 +99,7 @@ import { getPricedMobileFeePart, getMobileZipCodeData, getZipCodeData, - isServicableMobileWithData, + isServiceableMobileWithData, mapTimeSlot } from '@/helpers/service-location-helper'; import { Form } from 'vee-validate'; @@ -500,11 +500,11 @@ export default { const pmMobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS); const mobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_MOBILE_DAYS); const hasSelectedDate = !!this.getSelectedDate(); - const isServicableMobile = isServicableMobileWithData( - mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile, - mobileFirstObject.serviceabilityDetails?.isRecalibrationServiceableMobile + const isServiceableMobile = isServiceableMobileWithData( + mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile ?? null, + mobileFirstObject.serviceabilityDetails?.isRecalibrationServiceableMobile ?? null ); - if (!hasSelectedDate && isServicableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) { + if (!hasSelectedDate && isServiceableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) { const todayDateObject = new Date(); const todayDateString = convertDateToDateString(todayDateObject); const calendarViewDirection = 'future'; diff --git a/src/mixins/experiment-mixin.js b/src/mixins/experiment-mixin.js index 6668722b..fab87d88 100644 --- a/src/mixins/experiment-mixin.js +++ b/src/mixins/experiment-mixin.js @@ -13,7 +13,8 @@ export default { return experiment ? experiment : null; }, getExperimentByTestName(testName) { - return useMainStore().applicationUser.experiments.find((experiment) => experiment.testName === testName); + const experiment = useMainStore().applicationUser.experiments.find((experiment) => experiment.testName === testName); + return experiment ? experiment : null; }, getExperimentVariationNameByTestName(testName) { const experimentByTestName = this.getExperimentByTestName(testName); From c6d4cf32caa1dea7a504956b98e1cb26ac339283 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 31 Mar 2026 14:13:43 -0400 Subject: [PATCH 4/6] readability null means car doesnt check recal --- src/helpers/service-location-helper.js | 2 +- src/layouts/schedule-page/service-location/service-location.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/service-location-helper.js b/src/helpers/service-location-helper.js index 2c074a3a..5da94148 100644 --- a/src/helpers/service-location-helper.js +++ b/src/helpers/service-location-helper.js @@ -79,7 +79,7 @@ export function isServiceableMobileWithData(isGlassServiceableMobile, isRecalibr return false; } - if (isRecalibrationServiceableMobile !== null) { + if (isRecalibrationServiceableMobile === true || isRecalibrationServiceableMobile === false) { return ( isGlassServiceableMobile && isRecalibrationServiceableMobile diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 227c20bb..7476acd1 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -252,7 +252,7 @@ export default { return false; } - if (this.isRecalibrationServiceableMobile !== null) { + if (this.isRecalibrationServiceableMobile === true || this.isRecalibrationServiceableMobile === false) { return ( this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile From 8e902b27cbda41975b19fbe018cb86dc2e5c5223 Mon Sep 17 00:00:00 2001 From: scottkiener-at-safelite Date: Wed, 1 Apr 2026 10:52:05 -0400 Subject: [PATCH 5/6] Revert the revert --- src/store/index.js | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index f3b21047..c09a4a8d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1345,27 +1345,19 @@ export const useMainStore = defineStore({ }, getServiceabilityDetails(serviceZipCode) { - const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order; + const { damage, lineItems, parentAccountNumber, vehicle } = this.order; const { carId } = vehicle; - const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace); - const lineItemParts = [...(lineItems.glassParts || []), ...(lineItems.supportingItems || [])].map((part) => ({ - partNumber: part.partNumber, - recalibrationType: part.recalibrationType - })); + const flattenedGlassParts = getLineItemsFlattened(lineItems.glassParts); + const lineItemsList = flattenedGlassParts.map((part) => part.partNumber).join(','); - const params = buildURLSearchParams({ - applicationName: applicationConfig.APPLICATION_NAME, - parentAccountNumber, - referralSequenceNumber, - zip: serviceZipCode, - carId, - glassPieces: glassArray, - lineItems: lineItemParts - }); + let endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&isRepair=${damage.isRepair}`; + if (lineItemsList) { + endPoint += `&lineItems=${lineItemsList}`; + } return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, - endpoint: `${endpoints.GetServiceabilityDetails.url}?${params.toString()}` + endpoint: endPoint }); }, lookupVehicleByVin(vin) { From 4f3c79810887bfab645c7772d4b87f099f6bfd73 Mon Sep 17 00:00:00 2001 From: scottkiener-at-safelite Date: Wed, 1 Apr 2026 11:14:00 -0400 Subject: [PATCH 6/6] Add in environment swapping --- src/store/index.js | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index c09a4a8d..1d9dfafd 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1343,8 +1343,46 @@ export const useMainStore = defineStore({ endpoint: `${endpoints.GetMobileFeePart.url}?${params.toString()}` }); }, - getServiceabilityDetails(serviceZipCode) { + console.log('BEEP BOOP'); + console.log('--ENVIRONMENT DETECTOR ROBOT ENGAGED--'); + const currentEnvironment = applicationConfig.CURRENT_ENVIRONMENT; + console.log('I HAVE DETERMINED THAT THE CURRENT ENVIRONMENT IS:', currentEnvironment); + console.log('---'); + console.log('---'); + if (currentEnvironment === 'Localhost' || currentEnvironment === 'Dev') { + console.log('NEW SERVICEABILITY DETAILS METHOD ACTIVATED'); + return this.getServiceabilityDetailsNewMethod(serviceZipCode); + } else { + console.log('OLD SERVICEABILITY DETAILS METHOD ACTIVATED'); + return this.getServiceabilityDetailsOldMethod(serviceZipCode); + } + }, + getServiceabilityDetailsOldMethod(serviceZipCode) { + const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order; + const { carId } = vehicle; + const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace); + const lineItemParts = [...(lineItems.glassParts || []), ...(lineItems.supportingItems || [])].map((part) => ({ + partNumber: part.partNumber, + recalibrationType: part.recalibrationType + })); + + const params = buildURLSearchParams({ + applicationName: applicationConfig.APPLICATION_NAME, + parentAccountNumber, + referralSequenceNumber, + zip: serviceZipCode, + carId, + glassPieces: glassArray, + lineItems: lineItemParts + }); + + return globalMethods.callHttpClient({ + method: endpoints.GetServiceabilityDetails.method, + endpoint: `${endpoints.GetServiceabilityDetails.url}?${params.toString()}` + }); + }, + getServiceabilityDetailsNewMethod(serviceZipCode) { const { damage, lineItems, parentAccountNumber, vehicle } = this.order; const { carId } = vehicle; const flattenedGlassParts = getLineItemsFlattened(lineItems.glassParts);