INSR-523: Move claim registration after work order submission for USAA
- Uses callClaimRegistrationAtEnd config to skip it on coverage-statement and to call it after work order submission
This commit is contained in:
parent
7ea7390b6d
commit
7a7d064f0d
2 changed files with 12 additions and 2 deletions
|
|
@ -42,6 +42,14 @@ export async function submitWorkOrder({ submitType }) {
|
||||||
submitAfterSave: true,
|
submitAfterSave: true,
|
||||||
bailoutOnError: true
|
bailoutOnError: true
|
||||||
});
|
});
|
||||||
|
const shouldRegisterClaimAfterSubmission = store.isPolicyLookupSuccessful
|
||||||
|
&& store.vehicle.policyVehicleId != null
|
||||||
|
&& store.vehicle.policyVehicleId >= 0
|
||||||
|
&& store.isClaimRegistrationRequired
|
||||||
|
&& store.issConfig.callClaimRegistrationAtEnd;
|
||||||
|
if (shouldRegisterClaimAfterSubmission) {
|
||||||
|
await store.registerClaim();
|
||||||
|
}
|
||||||
await store.createSubmittedOrder(submitType);
|
await store.createSubmittedOrder(submitType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,8 @@ export default {
|
||||||
vehicle,
|
vehicle,
|
||||||
isClaimRegistrationRequired,
|
isClaimRegistrationRequired,
|
||||||
isPolicyLookupSuccessful,
|
isPolicyLookupSuccessful,
|
||||||
isPendingClaimRegistration
|
isPendingClaimRegistration,
|
||||||
|
issConfig
|
||||||
} = useMainStore();
|
} = useMainStore();
|
||||||
const { policyVehicleId } = vehicle;
|
const { policyVehicleId } = vehicle;
|
||||||
return (
|
return (
|
||||||
|
|
@ -340,6 +341,7 @@ export default {
|
||||||
&& policyVehicleId >= 0
|
&& policyVehicleId >= 0
|
||||||
&& isClaimRegistrationRequired
|
&& isClaimRegistrationRequired
|
||||||
&& isPendingClaimRegistration
|
&& isPendingClaimRegistration
|
||||||
|
&& !issConfig.callClaimRegistrationAtEnd
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
isRepair() {
|
isRepair() {
|
||||||
|
|
@ -453,7 +455,7 @@ export default {
|
||||||
async initializeComponent() {
|
async initializeComponent() {
|
||||||
if (this.shouldRegisterClaim) {
|
if (this.shouldRegisterClaim) {
|
||||||
await this.mainStore.registerClaim();
|
await this.mainStore.registerClaim();
|
||||||
} else if (!this.mainStore.isClaimRegistrationRequired && this.mainStore.order.insuranceCoverage.coverageType !== coverageType.NONE) {
|
} else if ((!this.mainStore.isClaimRegistrationRequired || this.mainStore.issConfig.callClaimRegistrationAtEnd) && this.mainStore.order.insuranceCoverage.coverageType !== coverageType.NONE) {
|
||||||
this.mainStore.updateCoverageStatus(coverageStatuses.VERIFIED);
|
this.mainStore.updateCoverageStatus(coverageStatuses.VERIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue