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,
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,8 @@ export default {
|
|||
vehicle,
|
||||
isClaimRegistrationRequired,
|
||||
isPolicyLookupSuccessful,
|
||||
isPendingClaimRegistration
|
||||
isPendingClaimRegistration,
|
||||
issConfig
|
||||
} = useMainStore();
|
||||
const { policyVehicleId } = vehicle;
|
||||
return (
|
||||
|
|
@ -340,6 +341,7 @@ export default {
|
|||
&& policyVehicleId >= 0
|
||||
&& isClaimRegistrationRequired
|
||||
&& isPendingClaimRegistration
|
||||
&& !issConfig.callClaimRegistrationAtEnd
|
||||
);
|
||||
},
|
||||
isRepair() {
|
||||
|
|
@ -453,7 +455,7 @@ export default {
|
|||
async initializeComponent() {
|
||||
if (this.shouldRegisterClaim) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue