use insurance pricing endpoint
This commit is contained in:
parent
fbdd66d5d0
commit
0d6f5ad70f
2 changed files with 17 additions and 17 deletions
|
|
@ -55,6 +55,10 @@ const endpoints = Object.freeze({
|
|||
url: '/parts/api/v1/parts/parts',
|
||||
method: 'POST'
|
||||
},
|
||||
GetInsurancePriceOrderItems: {
|
||||
url: '/price/api/v1/price/order-items-with-insurance-pricing',
|
||||
method: 'GET'
|
||||
},
|
||||
GetPriceOrderItems: {
|
||||
url: '/price/api/v1/price/order-items',
|
||||
method: 'GET'
|
||||
|
|
|
|||
|
|
@ -905,31 +905,27 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
async getPriceOrderItems(availableLineItems) {
|
||||
let zipCodeToUse = this.order.serviceLocation.zipCode;
|
||||
let ctuToUse = this.order.serviceLocation.zipCodeCtu;
|
||||
const zipCodeToUse = this.order.serviceLocation.zipCode;
|
||||
const ctuToUse = this.order.serviceLocation.zipCodeCtu;
|
||||
const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems);
|
||||
const { vehicle } = this.order;
|
||||
const { policy } = this.order;
|
||||
|
||||
// WARNING
|
||||
// TODO: this is temp test code until serviceLocation is complete.
|
||||
// and ctu is available. Also, EON may need to be implemented.
|
||||
zipCodeToUse = '44902';
|
||||
ctuToUse = '01820';
|
||||
const queryString =
|
||||
`ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}`
|
||||
let queryString =
|
||||
`ParentAccountNumber=${this.order.accountNumber}`
|
||||
+ `&CTU=${ctuToUse}`
|
||||
+ `&CarId=${vehicle.carId}`
|
||||
+ `&Make=${vehicle.make}`
|
||||
+ `&Model=${vehicle.model}`
|
||||
+ `&Year=${vehicle.year}`
|
||||
+ `&EON=${this.order.eon}`
|
||||
+ `&Deductible=${policy.deductible.repair}`
|
||||
+ `&ZipCode=${zipCodeToUse}`
|
||||
+ `${availableLineItemsFormattedForRequest}`;
|
||||
|
||||
const lineItemServerData = this.order.lineItems?.serverData;
|
||||
if (lineItemServerData) {
|
||||
queryString += `&ServerData=${encodeURIComponent(lineItemServerData)}`;
|
||||
}
|
||||
|
||||
const response = await globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.GetPriceOrderItems.method,
|
||||
endpoint: `${endpoints.GetPriceOrderItems.url}?${queryString}`
|
||||
method: endpoints.GetInsurancePriceOrderItems.method,
|
||||
endpoint: `${endpoints.GetInsurancePriceOrderItems.url}?${queryString}`
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
return [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue