INSR-8549 Fixed some edge cases

Fixed logger not logging Error type correctly
This commit is contained in:
Josh Dassinger 2026-02-23 09:55:36 -06:00
parent edbd6b3e2d
commit dbb46c58e7
5 changed files with 40 additions and 28 deletions

View file

@ -32,9 +32,16 @@ export class Logger {
} }
formatLogEntry(message, details) { formatLogEntry(message, details) {
return `Application: ${applicationConfig.APPLICATION_NAME}\n${message}\n${ let json = '';
details ? JSON.stringify(details, undefined, 2) : '' if (details) {
}`; if (details instanceof Error) {
json = JSON.stringify(details, Object.getOwnPropertyNames(details), 2);
} else {
json = JSON.stringify(details, undefined, 2)
}
}
return `Application: ${applicationConfig.APPLICATION_NAME} \n${message} \n${json}`;
} }
writeLogEntry(endpoint, logEntry) { writeLogEntry(endpoint, logEntry) {

View file

@ -86,12 +86,12 @@ export async function onProviderChanged() {
{ {
resultKey: 'glassFees', resultKey: 'glassFees',
promise: mainStore.getGlassFees() promise: mainStore.getGlassFees()
.then(async (glassFees) => await mainStore.getCombinedQuote(glassFees)) .then(async (glassFees) => await mainStore.getCombinedQuote(glassFees.data))
.then(async (quotedGlassFees) => mainStore.updateGlassFees(quotedGlassFees)) .then(async (quotedGlassFees) => mainStore.updateGlassFees(quotedGlassFees))
}, },
]; ];
if (isMobileAppointment && (this.mainStore.isNoComp || this.mainStore.isITAC)) { if (isMobileAppointment && (mainStore.isNoComp || mainStore.isITAC)) {
promiseResultMap.push({ promiseResultMap.push({
resultKey: 'priceMobileFee', resultKey: 'priceMobileFee',
promise: getPricedMobileFeePart(serviceZipCode).then(mobileFee => mainStore.updateMobileFee(mobileFee)) promise: getPricedMobileFeePart(serviceZipCode).then(mobileFee => mainStore.updateMobileFee(mobileFee))

View file

@ -225,7 +225,7 @@ export default {
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
// Call APIs // Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage); const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
const { isMobileAppointment, storeSelectedProvider, serviceZipCode } = getProviderData(); const { isMobileAppointment, storeServiceLocation, storeSelectedProvider, serviceZipCode } = getProviderData();
const zipCodeData = getZipCodeData(serviceZipCode); const zipCodeData = getZipCodeData(serviceZipCode);
const serviceabilityDetailsPromise = useMainStore().getServiceabilityDetails(serviceZipCode); const serviceabilityDetailsPromise = useMainStore().getServiceabilityDetails(serviceZipCode);
const providersPromise = useMainStore().getSafeliteProviders(serviceZipCode, 150); const providersPromise = useMainStore().getSafeliteProviders(serviceZipCode, 150);
@ -647,7 +647,9 @@ export default {
} }
}, },
mobileZipUpdatedFromServiceLocation(mobileZipServiceLocation) { mobileZipUpdatedFromServiceLocation(mobileZipServiceLocation) {
if (mobileZipServiceLocation) { if (mobileZipServiceLocation
&& (this.mobileProviderNumber !== mobileZipServiceLocation.mobileProviderNumber
|| !this.hasNeededServiceLocationData)) {
this.mobileProviderNumber = mobileZipServiceLocation.mobileProviderNumber; this.mobileProviderNumber = mobileZipServiceLocation.mobileProviderNumber;
this.selectedMobileZipCode = mobileZipServiceLocation.zipCode; this.selectedMobileZipCode = mobileZipServiceLocation.zipCode;
this.selectedServiceLocation = mobileZipServiceLocation; this.selectedServiceLocation = mobileZipServiceLocation;
@ -659,11 +661,15 @@ export default {
}, },
async providerChangedFromServiceLocation(newProvider) { async providerChangedFromServiceLocation(newProvider) {
this.selectedProvider = newProvider?.provider; this.selectedProvider = newProvider?.provider;
if (newProvider?.refreshDatePicker && newProvider.provider) { if (newProvider?.provider) {
showIssLoadingModal(true);
this.mainStore.updateServiceLocation(newProvider); this.mainStore.updateServiceLocation(newProvider);
showIssLoadingModal(true);
await onProviderChanged(); await onProviderChanged();
await this.refreshDatePicker(); if (newProvider.refreshDatePicker) {
await this.refreshDatePicker();
} else {
showIssLoadingModal(false);
}
} }
}, },
async refreshDatePicker() { async refreshDatePicker() {

View file

@ -88,7 +88,6 @@ import { useMainStore } from '@/store';
import { import {
getMobileZipCodeData, getMobileZipCodeData,
getPricedMobileFeePart, getPricedMobileFeePart,
getServiceabilityDetails
} from '@/helpers/service-location-helper'; } from '@/helpers/service-location-helper';
import { deepClone } from '@/helpers/object-helper.js'; import { deepClone } from '@/helpers/object-helper.js';
import vehicleProtectedQuestion from '@/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue'; import vehicleProtectedQuestion from '@/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue';
@ -273,7 +272,7 @@ export default {
const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); const mobileFeePart = await getPricedMobileFeePart(serviceZipCode);
// retrieve serviceability details // retrieve serviceability details
const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode); const serviceabilityDetails = await useMainStore().getServiceabilityDetails(serviceZipCode);
// update content related to service zip code // update content related to service zip code
this.$emit('updated-mobile-fee-part', mobileFeePart); this.$emit('updated-mobile-fee-part', mobileFeePart);

View file

@ -1340,7 +1340,7 @@ export const useMainStore = defineStore({
}); });
}, },
getServiceabilityDetails({ serviceZipCode }) { getServiceabilityDetails(serviceZipCode) {
const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order; const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order;
const { carId } = vehicle; const { carId } = vehicle;
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace); const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
@ -1842,26 +1842,26 @@ export const useMainStore = defineStore({
this.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu ?? this.order.serviceLocation.zipCodeCtu; this.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu ?? this.order.serviceLocation.zipCodeCtu;
this.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType ?? this.order.serviceLocation.appointmentType; this.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType ?? this.order.serviceLocation.appointmentType;
this.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected ?? this.order.serviceLocation.isVehicleProtected; this.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected ?? this.order.serviceLocation.isVehicleProtected;
this.updateServiceLocationProvider(serviceLocationInfo.provider)
if (serviceLocationInfo.provider) {
this.order.serviceLocation.provider = {
providerNumber: serviceLocationInfo.provider?.providerNumber,
address: {
streetAddress: serviceLocationInfo.provider?.address?.streetAddress,
city: serviceLocationInfo.provider?.address?.city,
state: serviceLocationInfo.provider?.address?.state,
zipCode: serviceLocationInfo.provider?.address?.zipCode,
zipCodeCtu: serviceLocationInfo.provider?.address?.zipCodeCtu
},
companyName: serviceLocationInfo.provider?.companyName,
phoneNumber: serviceLocationInfo.provider?.phoneNumber
};
}
this.order.serviceLocation.tpaSearchRadius = serviceLocationInfo.tpaSearchRadius; this.order.serviceLocation.tpaSearchRadius = serviceLocationInfo.tpaSearchRadius;
}, },
updateAppointmentType(appointmentType) { updateAppointmentType(appointmentType) {
this.order.serviceLocation.appointmentType = appointmentType; this.order.serviceLocation.appointmentType = appointmentType;
}, },
updateServiceLocationProvider(providerInfo) {
this.order.serviceLocation.provider = {
providerNumber: providerInfo?.providerNumber,
address: {
streetAddress: providerInfo?.address?.streetAddress,
city: providerInfo?.address?.city,
state: providerInfo?.address?.state,
zipCode: providerInfo?.address?.zipCode,
zipCodeCtu: providerInfo?.address?.zipCodeCtu
},
companyName: providerInfo?.companyName,
phoneNumber: providerInfo?.phoneNumber
};
},
resetState() { resetState() {
Object.assign(this, getDefaultState()); Object.assign(this, getDefaultState());
}, },