undo changes to serviceability details
This commit is contained in:
parent
a9b6e91dc3
commit
874250ac61
1 changed files with 18 additions and 63 deletions
|
|
@ -22,12 +22,11 @@ import {
|
||||||
repairWaivedForSelectedVehicle
|
repairWaivedForSelectedVehicle
|
||||||
} from '@/helpers/policy-vehicle-helper';
|
} from '@/helpers/policy-vehicle-helper';
|
||||||
import { buildURLSearchParams, getPartNumbersListForQueryString } from '@/helpers/querystring-helper';
|
import { buildURLSearchParams, getPartNumbersListForQueryString } from '@/helpers/querystring-helper';
|
||||||
import { getTopLevelGlassPartsWithRecal, isRecalPartOrHasChildRecalPart } from '@/helpers/recal-helper';
|
import { getTopLevelGlassPartsWithRecal } from '@/helpers/recal-helper';
|
||||||
import { getDateForSavedSessionTimeout } from '@/helpers/session-helper';
|
import { getDateForSavedSessionTimeout } from '@/helpers/session-helper';
|
||||||
import { isMobileDevice } from '@/helpers/useragent-helper';
|
import { isMobileDevice } from '@/helpers/useragent-helper';
|
||||||
import issPageValues from '@/router/router-constants/issPage-values';
|
import issPageValues from '@/router/router-constants/issPage-values';
|
||||||
import CoverageStatuses from '@/constants/coverage-statuses';
|
import CoverageStatuses from '@/constants/coverage-statuses';
|
||||||
import { buildQueryStringParameterFromArrayOfComplexObjects } from '@/helpers/querystring-helper';
|
|
||||||
|
|
||||||
const storeId = 'main';
|
const storeId = 'main';
|
||||||
|
|
||||||
|
|
@ -1346,72 +1345,28 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
|
|
||||||
getServiceabilityDetails(serviceZipCode) {
|
getServiceabilityDetails(serviceZipCode) {
|
||||||
const { vehicle, damage, parentAccountNumber, referralSequenceNumber } = this.order;
|
const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order;
|
||||||
const escapeRecalibrationType = (rt) => rt.split("&").join("%26");
|
const { carId } = vehicle;
|
||||||
|
|
||||||
const partialLineItemsObjects = this.order.lineItems.glassParts?.map(
|
|
||||||
(lineItem) => ({
|
|
||||||
partNumber: lineItem.partNumber,
|
|
||||||
recalibrationType:
|
|
||||||
lineItem.recalibrationType && isRecalPartOrHasChildRecalPart(lineItem)
|
|
||||||
? escapeRecalibrationType(lineItem.recalibrationType)
|
|
||||||
: undefined,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
var lineItems = null;
|
|
||||||
if (partialLineItemsObjects) {
|
|
||||||
lineItems = buildQueryStringParameterFromArrayOfComplexObjects(
|
|
||||||
partialLineItemsObjects,
|
|
||||||
"lineItems"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const carId = vehicle.carId;
|
|
||||||
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
|
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
|
||||||
|
const lineItemParts = [...(lineItems.glassParts || []), ...(lineItems.supportingItems || [])].map((part) => ({
|
||||||
|
partNumber: part.partNumber,
|
||||||
|
recalibrationType: part.recalibrationType
|
||||||
|
}));
|
||||||
|
|
||||||
const glassPieces = buildQueryStringParameterFromArrayOfComplexObjects(
|
const params = buildURLSearchParams({
|
||||||
glassArray,
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
"glassPieces"
|
parentAccountNumber,
|
||||||
);
|
referralSequenceNumber,
|
||||||
|
zip: serviceZipCode,
|
||||||
var endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&referralSequenceNumber=${referralSequenceNumber}&applicationName=${applicationConfig.ANALYTICS_APPLICATION_NAME}`;
|
carId,
|
||||||
if (lineItems) {
|
glassPieces: glassArray,
|
||||||
endPoint += `&${lineItems}`;
|
lineItems: lineItemParts
|
||||||
}
|
});
|
||||||
|
|
||||||
if (glassPieces) {
|
|
||||||
endPoint += `&${glassPieces}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
endPoint += `&isHeavyTruckVehicle=${vehicle.isBigTruck}`;
|
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetServiceabilityDetails.method,
|
method: endpoints.GetServiceabilityDetails.method,
|
||||||
endpoint: endPoint
|
endpoint: `${endpoints.GetServiceabilityDetails.url}?${params.toString()}`
|
||||||
});
|
});
|
||||||
// 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()}`
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
lookupVehicleByVin(vin) {
|
lookupVehicleByVin(vin) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue