forked from Yara724/api
Submit Fanavaran base on claim create for all flows.
GEN.03 no longer waits on vehicle review; V3/file-maker create triggers early auto-submit, and expertise auto-path soft-ensures prior stages when each client's body is ready. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6423,18 +6423,14 @@ export class ClaimRequestManagementService {
|
||||
};
|
||||
}
|
||||
|
||||
if (!claimCase.claimId) {
|
||||
await this.autoSubmitToFanavaranV2OnClaimCreated(claimCaseId);
|
||||
claimCase = await this.claimCaseDbService.findById(claimCaseId);
|
||||
}
|
||||
// Same ordered soft-ensure as manual expertise submit: base → damage → files.
|
||||
await this.completeFanavaranExpertisePrerequisites(
|
||||
claimCaseId,
|
||||
clientKey,
|
||||
FanavaranAuditSource.AUTO_SUBMIT,
|
||||
);
|
||||
claimCase = await this.claimCaseDbService.findById(claimCaseId);
|
||||
const product = await this.resolveFanavaranClaimProduct(claimCaseId);
|
||||
if (fanavaranHasDamageCaseStage(product) && !claimCase?.dmgCaseId) {
|
||||
await this.autoSubmitFanavaranDamageCaseOnOuterPartsSelected(
|
||||
claimCaseId,
|
||||
claimCase?.damage?.selectedParts ?? [],
|
||||
);
|
||||
claimCase = await this.claimCaseDbService.findById(claimCaseId);
|
||||
}
|
||||
|
||||
const { payload, warnings } = await this.buildFanavaranExpertisePayload({
|
||||
claimCase,
|
||||
@@ -6559,9 +6555,8 @@ export class ClaimRequestManagementService {
|
||||
return 'Already submitted to Fanavaran';
|
||||
}
|
||||
|
||||
if (!claimCase.fanavaranVehicleReview?.approved) {
|
||||
return 'Expert vehicle review is required before Fanavaran submission';
|
||||
}
|
||||
// GEN.03 base claim is sent as soon as the local claim exists.
|
||||
// Vehicle review remains required for damage / attachments / expertise only.
|
||||
|
||||
const clientKey = resolveFanavaranClientKey();
|
||||
const notifierAllowed =
|
||||
@@ -7643,7 +7638,7 @@ export class ClaimRequestManagementService {
|
||||
);
|
||||
}
|
||||
if (!existing) throw new NotFoundException('Claim case not found');
|
||||
this.assertFanavaranVehicleReviewApproved(existing);
|
||||
// Vehicle review is not required for GEN.03 base — only for later stages.
|
||||
const notifierAllowed =
|
||||
clientKey === 'tejaratno'
|
||||
? await this.tejaratNotifierAllowedIds(clientKey)
|
||||
|
||||
Reference in New Issue
Block a user