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 = [];
|
let pricingResults = [];
|
||||||
if (useMainStore().order.policy.policyLookupSuccessful) {
|
if (useMainStore().order.policy.policyLookupSuccessful && useMainStore().order.vehicle.policyVehicleId) {
|
||||||
|
await useMainStore().getFinalDeductible();
|
||||||
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems)
|
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
const errorPageData = {
|
const errorPageData = {
|
||||||
|
|
@ -187,7 +188,6 @@ export default {
|
||||||
useMainStore().updatePageData({ page: issPageValues.BAILOUT_PAGE, data: errorPageData });
|
useMainStore().updatePageData({ page: issPageValues.BAILOUT_PAGE, data: errorPageData });
|
||||||
next(`/?issPage=${issPageValues.BAILOUT_PAGE}`);
|
next(`/?issPage=${issPageValues.BAILOUT_PAGE}`);
|
||||||
});
|
});
|
||||||
await useMainStore().getFinalDeductible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
|
|
@ -357,6 +357,7 @@ export default {
|
||||||
async initializeComponent() {
|
async initializeComponent() {
|
||||||
useMainStore().updatePolicyITACFlag(this.verifiedITAC);
|
useMainStore().updatePolicyITACFlag(this.verifiedITAC);
|
||||||
if (this.policyLookupSuccessful
|
if (this.policyLookupSuccessful
|
||||||
|
&& useMainStore().order.vehicle.policyVehicleId
|
||||||
&& useMainStore().isClaimRegistrationRequired
|
&& useMainStore().isClaimRegistrationRequired
|
||||||
&& (this.coveredAndServicePriceAboveOrEqualDeductible || this.verifiedITAC)) {
|
&& (this.coveredAndServicePriceAboveOrEqualDeductible || this.verifiedITAC)) {
|
||||||
await useMainStore().registerClaim()?.catch(() => {});
|
await useMainStore().registerClaim()?.catch(() => {});
|
||||||
|
|
|
||||||
|
|
@ -897,8 +897,7 @@ export const useMainStore = defineStore({
|
||||||
}
|
}
|
||||||
const ctuToUse = this.order.serviceLocation.zipCodeCtu;
|
const ctuToUse = this.order.serviceLocation.zipCodeCtu;
|
||||||
const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems);
|
const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems);
|
||||||
const { policy } = this.order;
|
const deductibleToUse = this.order.currentDeductible;
|
||||||
const deductibleToUse = this.damage.isRepair ? policy.deductible.repair : policy.deductible.replace;
|
|
||||||
|
|
||||||
let queryString =
|
let queryString =
|
||||||
`ParentAccountNumber=${this.order.accountNumber}`
|
`ParentAccountNumber=${this.order.accountNumber}`
|
||||||
|
|
@ -1396,8 +1395,8 @@ export const useMainStore = defineStore({
|
||||||
this.order.policy.endorsements = vehicle?.endorsements;
|
this.order.policy.endorsements = vehicle?.endorsements;
|
||||||
|
|
||||||
// TODO logic should be more complicated later on
|
// TODO logic should be more complicated later on
|
||||||
this.order.originalDeductible = parseFloat(vehicle.deductible);
|
this.order.originalDeductible = vehicle.deductible;
|
||||||
this.order.currentDeductible = parseFloat(vehicle.deductible);
|
this.order.currentDeductible = vehicle.deductible;
|
||||||
|
|
||||||
this.resetSupportingItemsState();
|
this.resetSupportingItemsState();
|
||||||
this.resetVapsState();
|
this.resetVapsState();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue