Merge pull request #516 from Safelite/feature/SSR-1023
call final-deductible if vehicle is a policy vehicle
This commit is contained in:
commit
d119b9177d
2 changed files with 6 additions and 6 deletions
|
|
@ -171,7 +171,8 @@ export default {
|
|||
];
|
||||
|
||||
let pricingResults = [];
|
||||
if (useMainStore().order.policy.policyLookupSuccessful) {
|
||||
if (useMainStore().order.policy.policyLookupSuccessful && useMainStore().order.vehicle.policyVehicleId) {
|
||||
await useMainStore().getFinalDeductible();
|
||||
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems)
|
||||
.catch((err) => {
|
||||
const errorPageData = {
|
||||
|
|
@ -187,7 +188,6 @@ export default {
|
|||
useMainStore().updatePageData({ page: issPageValues.BAILOUT_PAGE, data: errorPageData });
|
||||
next(`/?issPage=${issPageValues.BAILOUT_PAGE}`);
|
||||
});
|
||||
await useMainStore().getFinalDeductible();
|
||||
}
|
||||
|
||||
// Call the "next" function to complete the transition to this page.
|
||||
|
|
@ -357,6 +357,7 @@ export default {
|
|||
async initializeComponent() {
|
||||
useMainStore().updatePolicyITACFlag(this.verifiedITAC);
|
||||
if (this.policyLookupSuccessful
|
||||
&& useMainStore().order.vehicle.policyVehicleId
|
||||
&& useMainStore().isClaimRegistrationRequired
|
||||
&& (this.coveredAndServicePriceAboveOrEqualDeductible || this.verifiedITAC)) {
|
||||
await useMainStore().registerClaim()?.catch(() => {});
|
||||
|
|
|
|||
|
|
@ -897,8 +897,7 @@ export const useMainStore = defineStore({
|
|||
}
|
||||
const ctuToUse = this.order.serviceLocation.zipCodeCtu;
|
||||
const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems);
|
||||
const { policy } = this.order;
|
||||
const deductibleToUse = this.damage.isRepair ? policy.deductible.repair : policy.deductible.replace;
|
||||
const deductibleToUse = this.order.currentDeductible;
|
||||
|
||||
let queryString =
|
||||
`ParentAccountNumber=${this.order.accountNumber}`
|
||||
|
|
@ -1396,8 +1395,8 @@ export const useMainStore = defineStore({
|
|||
this.order.policy.endorsements = vehicle?.endorsements;
|
||||
|
||||
// TODO logic should be more complicated later on
|
||||
this.order.originalDeductible = parseFloat(vehicle.deductible);
|
||||
this.order.currentDeductible = parseFloat(vehicle.deductible);
|
||||
this.order.originalDeductible = vehicle.deductible;
|
||||
this.order.currentDeductible = vehicle.deductible;
|
||||
|
||||
this.resetSupportingItemsState();
|
||||
this.resetVapsState();
|
||||
|
|
|
|||
Loading…
Reference in a new issue