Merge pull request #761 from Safelite/defect/digital/SSR-1385
SSR-1385 Allow Repair NoComp to call ITAC pricing API
This commit is contained in:
commit
e151ba5548
1 changed files with 15 additions and 24 deletions
|
|
@ -364,31 +364,22 @@ export default {
|
|||
...(clonedGlassParts ?? [])
|
||||
];
|
||||
|
||||
let pricingRequest;
|
||||
if (!this.isRepair) {
|
||||
// If we are NOT a repair we call the ITAC pricing service
|
||||
pricingRequest = useMainStore().getITACPriceOrderItems(availableLineItems);
|
||||
} else if (this.mainStore.isNoComp) {
|
||||
// If we are a repair and are NoComp we call the insurance pricing service.
|
||||
pricingRequest = useMainStore().getInsurancePriceOrderItems(availableLineItems);
|
||||
} else {
|
||||
// We don't price parts if we are repair and is Deductible
|
||||
return;
|
||||
// We only call the ITAC pricing endpoint if we are not repair or we are NoComp
|
||||
if (!this.isRepair || this.mainStore.isNoComp) {
|
||||
const pricingResults = useMainStore().getITACPriceOrderItems(availableLineItems)
|
||||
.catch((err) => {
|
||||
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
||||
availableLineItems.map((li) => li.partNumber),
|
||||
{
|
||||
code: err.code,
|
||||
message: err.message,
|
||||
data: err.data
|
||||
}
|
||||
));
|
||||
this.navigateWithScenario(navigationScenarios.PRICING_LOOKUP_ERROR);
|
||||
});
|
||||
this.setBaseServiceLineItems(pricingResults);
|
||||
}
|
||||
|
||||
const pricingResults = await pricingRequest.catch((err) => {
|
||||
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
||||
availableLineItems.map((li) => li.partNumber),
|
||||
{
|
||||
code: err.code,
|
||||
message: err.message,
|
||||
data: err.data
|
||||
}
|
||||
));
|
||||
this.navigateWithScenario(navigationScenarios.PRICING_LOOKUP_ERROR);
|
||||
});
|
||||
|
||||
this.setBaseServiceLineItems(pricingResults);
|
||||
},
|
||||
async navigateForward() {
|
||||
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue