From 2d5ade33d2cd5b491719813a2ac077aaf4572593 Mon Sep 17 00:00:00 2001 From: SepehrYahyaee <7heycallmegray@gmail.com> Date: Sat, 25 Jul 2026 09:29:12 +0330 Subject: [PATCH] v4 bug fixed --- .../claim-request-management.service.ts | 10 ++++++++++ .../request-management.service.ts | 13 +++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/claim-request-management/claim-request-management.service.ts b/src/claim-request-management/claim-request-management.service.ts index 453782a..3b4685b 100644 --- a/src/claim-request-management/claim-request-management.service.ts +++ b/src/claim-request-management/claim-request-management.service.ts @@ -8770,6 +8770,16 @@ export class ClaimRequestManagementService { if (advanced) { // This request won the race — reflect the final state in the response. allDocumentsUploaded = true; + // Now that the FileMaker's document phase is complete, promote the + // blame file to WAITING_FOR_FILE_REVIEWER so the frontend shows the + // correct sealed state when the FileMaker returns. + const blameId = (afterWrite as any).blameRequestId; + if (blameId) { + await this.blameRequestDbService.findByIdAndUpdate( + String(blameId), + { $set: { status: BlameCaseStatus.WAITING_FOR_FILE_REVIEWER } }, + ); + } } } else if ( afterWrite.status === ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER || diff --git a/src/request-management/request-management.service.ts b/src/request-management/request-management.service.ts index d1aab38..5669630 100644 --- a/src/request-management/request-management.service.ts +++ b/src/request-management/request-management.service.ts @@ -9288,12 +9288,11 @@ export class RequestManagementService { fresh.workflow.currentStep = WorkflowStep.FIRST_INVITE_SECOND; fresh.workflow.nextStep = WorkflowStep.SECOND_INITIAL_FORM; } else { - // CAR_BODY: FileMaker is done — seal the file for FileReviewer pickup + // CAR_BODY: FileMaker's narrative is done — move to document-upload step. + // blame.status transitions to WAITING_FOR_FILE_REVIEWER only after the + // FileMaker completes all document uploads, not here at sign time. fresh.workflow.currentStep = WorkflowStep.FIRST_COMPLETED; fresh.workflow.nextStep = WorkflowStep.WAITING_FOR_GUILT_DECISION; - if (isFileMakerActor) { - fresh.status = CaseStatus.WAITING_FOR_FILE_REVIEWER; - } } } else { this.pushWorkflowSteps(fresh, [ @@ -9305,10 +9304,8 @@ export class RequestManagementService { ]); fresh.workflow.currentStep = WorkflowStep.SECOND_COMPLETED; fresh.workflow.nextStep = WorkflowStep.WAITING_FOR_GUILT_DECISION; - // THIRD_PARTY: second party sign is FileMaker's last step — seal for FileReviewer - if (isFileMakerActor) { - fresh.status = CaseStatus.WAITING_FOR_FILE_REVIEWER; - } + // blame.status transitions to WAITING_FOR_FILE_REVIEWER only after the + // FileMaker completes all document uploads, not here at sign time. } await (fresh as any).save(); }