commit
d56629b346
2 changed files with 18 additions and 29 deletions
|
|
@ -139,7 +139,7 @@ const endpoints = Object.freeze({
|
|||
},
|
||||
TaxOrderItems: {
|
||||
url: `${PRICE_BASE_URL}/taxed-order-items`,
|
||||
method: 'GET'
|
||||
method: 'POST'
|
||||
},
|
||||
LogExperimentExposureIfAssigned: {
|
||||
url: `${EXPERIMENTS_BASE_URL}/log-exposure`,
|
||||
|
|
|
|||
|
|
@ -2365,38 +2365,27 @@ export const useMainStore = defineStore({
|
|||
const serviceLocationCity = serviceLocation.city;
|
||||
const serviceLocationState = serviceLocation.state;
|
||||
const serviceLocationZipCode = serviceLocation.zipCode;
|
||||
|
||||
const lineItemsQueryString = getTaxLineItemQueryString(pricedLineItems, 'lineItems');
|
||||
|
||||
let queryString = '';
|
||||
if (appointmentType === AppointmentTypeStrings.MOBILE
|
||||
|| appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) {
|
||||
queryString =
|
||||
`ParentAccountNumber=${this.order.parentAccountNumber}`
|
||||
+ `&BillToAccountNumber=${this.billToAccountNumber}`
|
||||
+ `&ProviderNumber=${this.providerNumber}`
|
||||
+ `&AppointmentType=${appointmentType}`
|
||||
+ `&ServiceLocation.City=${serviceLocationCity}`
|
||||
+ `&ServiceLocation.State=${serviceLocationState}`
|
||||
+ `&ServiceLocation.ZipCode=${serviceLocationZipCode}`
|
||||
+ `${lineItemsQueryString}`;
|
||||
} else {
|
||||
queryString =
|
||||
`ParentAccountNumber=${this.order.parentAccountNumber}`
|
||||
+ `&BillToAccountNumber=${this.billToAccountNumber}`
|
||||
+ `&ProviderNumber=${this.providerNumber}`
|
||||
+ `&AppointmentType=${appointmentType}`
|
||||
+ `${lineItemsQueryString}`;
|
||||
}
|
||||
|
||||
const lineItemServerData = this.order.lineItems.serverData;
|
||||
if (lineItemServerData) {
|
||||
queryString += `&ServerData=${encodeURIComponent(lineItemServerData)}`;
|
||||
}
|
||||
|
||||
const isMobileApt = appointmentType === AppointmentTypeStrings.MOBILE
|
||||
|| appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
|
||||
|
||||
const retPricedLineItems = await globalMethods.callHttpClient({
|
||||
method: endpoints.TaxOrderItems.method,
|
||||
endpoint: `${endpoints.TaxOrderItems.url}?${queryString}`
|
||||
endpoint: endpoints.TaxOrderItems.url,
|
||||
payload: {
|
||||
ParentAccountNumber: this.order.parentAccountNumber,
|
||||
BillToAccountNumber: this.billToAccountNumber,
|
||||
ProviderNumber: this.providerNumber,
|
||||
AppointmentType: appointmentType,
|
||||
PricedLineItems: getLineItemsFlattened(pricedLineItems),
|
||||
ServiceLocation: {
|
||||
City: isMobileApt ? serviceLocationCity : null,
|
||||
State: isMobileApt ? serviceLocationState : null,
|
||||
ZipCode: isMobileApt ? serviceLocationZipCode : null,
|
||||
},
|
||||
ServerData: lineItemServerData ? lineItemServerData : "",
|
||||
},
|
||||
}).then((response) => {
|
||||
this.order.lineItems.serverData = response.data.serverData;
|
||||
return addTaxesToPricedLineItems(pricedLineItems, response.data.taxedLineItems);
|
||||
|
|
|
|||
Loading…
Reference in a new issue