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