Merge pull request #1001 from Safelite/feature/CASH-1952

CASH-1952
This commit is contained in:
CarlNation 2026-01-12 09:42:16 -05:00 committed by GitHub
commit d56629b346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 29 deletions

View file

@ -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`,

View file

@ -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);