Merge pull request #516 from Safelite/feature/SSR-1023

call final-deductible if vehicle is a policy vehicle
This commit is contained in:
katiekroell 2023-12-05 15:24:51 -05:00 committed by GitHub
commit d119b9177d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -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(() => {});

View file

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