From 18093c18852fa8e888c70a4f23f4d0e772a945ee Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 26 Feb 2024 11:33:14 -0500 Subject: [PATCH 1/5] carrier phone number on frontend --- src/constants/endpoints.js | 4 ++++ src/layouts/tpa-confirmation/tpa-confirmation.vue | 5 +++-- src/store/index.js | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 60ef3ba8..de544f57 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -99,6 +99,10 @@ const endpoints = Object.freeze({ url: '/vehicle/api/v1/vehicle/lookup', method: 'GET' }, + GetAccountInfo: { + url: '/account/api/v1/account/', + method: 'GET' + }, LogExperimentExposureIfAssigned: { url: '/experiments/api/v1/experiments/log-exposure', method: 'POST' diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue index 3741f4b8..f4c94be6 100644 --- a/src/layouts/tpa-confirmation/tpa-confirmation.vue +++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue @@ -161,9 +161,10 @@ export default { isVerified() { return useMainStore().order.payment.insuranceCoverage.isVerified; }, - // TODO: Replace with actual carrier number when account service is ready carrierPhoneNumber() { - return '800-000-0000'; + const accountInfo = useMainStore().getClientAccountInfo(); + const { phoneNumber } = accountInfo; + return phoneNumber; }, carrierName() { return this.mainStore.issConfig.clientName; diff --git a/src/store/index.js b/src/store/index.js index 2b35d46d..fa1e57e9 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -925,6 +925,13 @@ export const useMainStore = defineStore({ }); }, + getClientAccountInfo() { + return globalMethods.callHttpClient({ + method: endpoints.GetAccountInfo.method, + endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber + }); + }, + async getSupportingItems() { const glassPartsArray = this.order.lineItems.glassParts ?? []; const { carId } = this.order.vehicle; From ca10097f4011351b7ac732bd5334e03a735c0e33 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 26 Feb 2024 12:01:38 -0500 Subject: [PATCH 2/5] final changes --- src/layouts/tpa-confirmation/tpa-confirmation.vue | 9 ++++----- src/store/index.js | 9 ++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue index f4c94be6..83776523 100644 --- a/src/layouts/tpa-confirmation/tpa-confirmation.vue +++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue @@ -161,22 +161,21 @@ export default { isVerified() { return useMainStore().order.payment.insuranceCoverage.isVerified; }, - carrierPhoneNumber() { - const accountInfo = useMainStore().getClientAccountInfo(); - const { phoneNumber } = accountInfo; - return phoneNumber; - }, carrierName() { return this.mainStore.issConfig.clientName; }, carrierUrl() { return this.mainStore.issConfig.successReturnURL; + }, + carrierPhoneNumber() { + return this.toDisplayPhoneNumber(useMainStore().order.carrierPhoneNumber); } }, mounted() { if (this.carrierUrl) { this.$refs.siteFooter.updateButtonText(`Go back to ${this.carrierName}`); } + useMainStore().getCarrierAccountInfo(); }, methods: { diff --git a/src/store/index.js b/src/store/index.js index 06da1c35..f3d4336d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -175,7 +175,8 @@ const getDefaultState = () => ({ eon: null, workOrderNumber: null, originalDeductible: null, - currentDeductible: null + currentDeductible: null, + carrierPhoneNumber: null }, applicationUser: { experiments: [], @@ -925,11 +926,13 @@ export const useMainStore = defineStore({ }); }, - getClientAccountInfo() { - return globalMethods.callHttpClient({ + async getCarrierAccountInfo() { + const response = await globalMethods.callHttpClient({ method: endpoints.GetAccountInfo.method, endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber }); + this.order.carrierPhoneNumber = response.data.phoneNumber; + return response; }, async getSupportingItems() { From 85ee04ab9040e868f92fb49c3a84ca3ced9ada9f Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 26 Feb 2024 14:10:40 -0500 Subject: [PATCH 3/5] PR feedback changes --- src/layouts/tpa-confirmation/tpa-confirmation.vue | 11 ++++++++--- src/store/index.js | 15 +++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue index 83776523..135d47ab 100644 --- a/src/layouts/tpa-confirmation/tpa-confirmation.vue +++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue @@ -99,13 +99,19 @@ export default { async beforeRouteEnter(to, from, next) { // Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.issPage); + const accountInfoPromise = useMainStore().getCarrierAccountInfo(); // Settle promises and get results const promiseResultMap = [ { resultKey: 'cmsContent', promise: cmsContentPromise - }]; - // use resultMap to populate layout content. + }, + { + resultKey: 'accountInfo', + promise: accountInfoPromise + } + ]; + // use resultMap to populate layout content. const resultMap = await settleAllPromises(promiseResultMap); next((vm) => { vm.setCmsContent(resultMap.cmsContent); @@ -175,7 +181,6 @@ export default { if (this.carrierUrl) { this.$refs.siteFooter.updateButtonText(`Go back to ${this.carrierName}`); } - useMainStore().getCarrierAccountInfo(); }, methods: { diff --git a/src/store/index.js b/src/store/index.js index f3d4336d..9dd4e7ce 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -926,13 +926,16 @@ export const useMainStore = defineStore({ }); }, - async getCarrierAccountInfo() { - const response = await globalMethods.callHttpClient({ - method: endpoints.GetAccountInfo.method, - endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber + getCarrierAccountInfo() { + return new Promise((resolve, reject) => { + globalMethods.callHttpClient({ + method: endpoints.GetAccountInfo.method, + endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber + }).then((response) => { + this.order.carrierPhoneNumber = response.data.phoneNumber; + return resolve(response.data); + }).catch((error) => reject(error)); }); - this.order.carrierPhoneNumber = response.data.phoneNumber; - return response; }, async getSupportingItems() { From 16b8691d42c7a19cdc11e19f662bc7864e5636bd Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 27 Feb 2024 10:33:30 -0500 Subject: [PATCH 4/5] auto-save formatting only to prevent un needed compare in the actual PR later. --- src/layouts/payment-page/payment-page.vue | 386 ++++++++++++++++------ 1 file changed, 293 insertions(+), 93 deletions(-) diff --git a/src/layouts/payment-page/payment-page.vue b/src/layouts/payment-page/payment-page.vue index 36f072c6..c37fde79 100644 --- a/src/layouts/payment-page/payment-page.vue +++ b/src/layouts/payment-page/payment-page.vue @@ -38,71 +38,192 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +