updating deductible logic WIP
This commit is contained in:
parent
0ab2752953
commit
c148de71a6
2 changed files with 24 additions and 9 deletions
|
|
@ -336,7 +336,7 @@ export default {
|
||||||
return damageString === 'match' ? '' : damageString;
|
return damageString === 'match' ? '' : damageString;
|
||||||
},
|
},
|
||||||
deductibleValue() {
|
deductibleValue() {
|
||||||
return useMainStore().order.currentDeductible;
|
return this.isRepair ? useMainStore().order.currentRepairDeductible : useMainStore().order.currentReplaceDeductible;
|
||||||
},
|
},
|
||||||
isNoCompQuoteVisible() {
|
isNoCompQuoteVisible() {
|
||||||
return this.mainStore.isVerified && this.mainStore.isNoComp;
|
return this.mainStore.isVerified && this.mainStore.isNoComp;
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,12 @@ export const getDefaultState = () => ({
|
||||||
customerPortalLoginToken: null,
|
customerPortalLoginToken: null,
|
||||||
originalDeductible: null,
|
originalDeductible: null,
|
||||||
currentDeductible: null,
|
currentDeductible: null,
|
||||||
|
originalReplaceDeductible: null,
|
||||||
|
currentReplaceDeductible: null,
|
||||||
|
originalRepairDeductible: null,
|
||||||
|
currentRepairDeductible: null,
|
||||||
|
totalTaxAmount: null,
|
||||||
|
waiverReasons: null,
|
||||||
carrierPhoneNumber: null,
|
carrierPhoneNumber: null,
|
||||||
loadedFromCookie: false,
|
loadedFromCookie: false,
|
||||||
loadedFromDupeCheck: null,
|
loadedFromDupeCheck: null,
|
||||||
|
|
@ -653,7 +659,7 @@ export const useMainStore = defineStore({
|
||||||
safelitePolicy: {
|
safelitePolicy: {
|
||||||
policies: []
|
policies: []
|
||||||
},
|
},
|
||||||
actualDeductible: this.order.currentDeductible?.toString() ?? ''
|
actualDeductible: this.isRepair ? this.order.currentRepairDeductible?.toString() ?? '' : this.order.currentReplaceDeductible?.toString() ?? ''
|
||||||
},
|
},
|
||||||
lossInfo: {
|
lossInfo: {
|
||||||
dateOfLoss: this.order.policy.dateOfLoss,
|
dateOfLoss: this.order.policy.dateOfLoss,
|
||||||
|
|
@ -716,8 +722,8 @@ export const useMainStore = defineStore({
|
||||||
manualGlassNames: manualGlassNamesArray,
|
manualGlassNames: manualGlassNamesArray,
|
||||||
policyState: this.order.customer.address.state,
|
policyState: this.order.customer.address.state,
|
||||||
status: this.order.policy.status,
|
status: this.order.policy.status,
|
||||||
originalDeductible: this.order.originalDeductible,
|
originalDeductible: this.isRepair ? this.order.originalRepairDeductible : this.order.originalReplaceDeductible,
|
||||||
currentDeductible: this.order.currentDeductible,
|
currentDeductible: this.isRepair ? this.order.currentRepairDeductible : this.order.currentReplaceDeductible,
|
||||||
noCoverage: false,
|
noCoverage: false,
|
||||||
isRepair: this.order.damage.isRepair,
|
isRepair: this.order.damage.isRepair,
|
||||||
policyNumber: this.order.policy.policyNumber,
|
policyNumber: this.order.policy.policyNumber,
|
||||||
|
|
@ -731,7 +737,8 @@ export const useMainStore = defineStore({
|
||||||
}
|
}
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
this.order.policy.policyData = r.data.policyData;
|
this.order.policy.policyData = r.data.policyData;
|
||||||
this.updateDeductible(r.data.deductible);
|
this.updateDeductible(r.data);
|
||||||
|
// this.updateDeductible(r.data);
|
||||||
return resolve(r);
|
return resolve(r);
|
||||||
}).catch((error) => reject(error));
|
}).catch((error) => reject(error));
|
||||||
});
|
});
|
||||||
|
|
@ -2031,8 +2038,12 @@ export const useMainStore = defineStore({
|
||||||
this.order.policy.endorsements = coverage?.endorsements;
|
this.order.policy.endorsements = coverage?.endorsements;
|
||||||
|
|
||||||
// TODO logic should be more complicated later on
|
// TODO logic should be more complicated later on
|
||||||
this.order.originalDeductible = coverage.deductible;
|
this.order.originalReplaceDeductible = coverage.deductible;
|
||||||
this.order.currentDeductible = coverage.deductible;
|
this.order.currentReplaceDeductible = coverage.deductible;
|
||||||
|
this.order.originalReplaceDeductible = this.order.policy.deductible.replace;
|
||||||
|
this.order.currentReplaceDeductible = this.order.policy.deductible.replace;
|
||||||
|
this.order.originalRepairDeductible = this.order.policy.deductible.repair;
|
||||||
|
this.order.currentRepairDeductible = this.order.policy.deductible.repair;
|
||||||
},
|
},
|
||||||
|
|
||||||
resetOrder() {
|
resetOrder() {
|
||||||
|
|
@ -2316,8 +2327,12 @@ export const useMainStore = defineStore({
|
||||||
updateIsSafeliteProvider(isSafelite) {
|
updateIsSafeliteProvider(isSafelite) {
|
||||||
this.order.serviceLocation.IsSafeliteProvider = isSafelite;
|
this.order.serviceLocation.IsSafeliteProvider = isSafelite;
|
||||||
},
|
},
|
||||||
updateDeductible(finalDeductible) {
|
updateDeductible(deductibleInfo) {
|
||||||
this.order.currentDeductible = finalDeductible;
|
if (!this.order.damage.isRepair) {
|
||||||
|
this.order.currentReplaceDeductible = deductibleInfo.deductible;
|
||||||
|
} else {
|
||||||
|
this.order.currentRepairDeductible = deductibleInfo.deductible;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
savePartQuestionAnswers(partQuestionAnswersArray) {
|
savePartQuestionAnswers(partQuestionAnswersArray) {
|
||||||
// if part question answers have changed, reset subsequent question answers
|
// if part question answers have changed, reset subsequent question answers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue