From 36a34e27b3b45f0e2c31f99ac0b228ef215fb2a2 Mon Sep 17 00:00:00 2001 From: SepehrYahyaee <7heycallmegray@gmail.com> Date: Tue, 14 Jul 2026 11:23:39 +0330 Subject: [PATCH] YARA-1115 --- .../request-management.service.ts | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/request-management/request-management.service.ts b/src/request-management/request-management.service.ts index f2fb3e2..9a8f51e 100644 --- a/src/request-management/request-management.service.ts +++ b/src/request-management/request-management.service.ts @@ -8695,13 +8695,16 @@ export class RequestManagementService { partyRole: PartyRole, actor: any, ): void { + // V4/V5 FileMaker files skip the location step — it is auto-completed here. + const skipLocation = !!(req as any).isMadeByFileMaker; + if (partyRole === PartyRole.FIRST) { - this.pushWorkflowSteps(req, [ - WorkflowStep.CREATED, - WorkflowStep.FIRST_INITIAL_FORM, - ]); - req.workflow.currentStep = WorkflowStep.FIRST_LOCATION; - req.workflow.nextStep = WorkflowStep.FIRST_VOICE; + const completedSteps = skipLocation + ? [WorkflowStep.CREATED, WorkflowStep.FIRST_INITIAL_FORM, WorkflowStep.FIRST_LOCATION] + : [WorkflowStep.CREATED, WorkflowStep.FIRST_INITIAL_FORM]; + this.pushWorkflowSteps(req, completedSteps); + req.workflow.currentStep = skipLocation ? WorkflowStep.FIRST_VOICE : WorkflowStep.FIRST_LOCATION; + req.workflow.nextStep = skipLocation ? WorkflowStep.FIRST_DESCRIPTION : WorkflowStep.FIRST_VOICE; const firstIdx = this.getPartyIndex(req, PartyRole.FIRST); const guiltyUserId = req.parties?.[firstIdx]?.person?.userId; @@ -8716,9 +8719,12 @@ export class RequestManagementService { (req as any).markModified("expert"); } } else { - this.pushWorkflowSteps(req, [WorkflowStep.SECOND_INITIAL_FORM]); - req.workflow.currentStep = WorkflowStep.SECOND_LOCATION; - req.workflow.nextStep = WorkflowStep.SECOND_VOICE; + const completedSteps = skipLocation + ? [WorkflowStep.SECOND_INITIAL_FORM, WorkflowStep.SECOND_LOCATION] + : [WorkflowStep.SECOND_INITIAL_FORM]; + this.pushWorkflowSteps(req, completedSteps); + req.workflow.currentStep = skipLocation ? WorkflowStep.SECOND_VOICE : WorkflowStep.SECOND_LOCATION; + req.workflow.nextStep = skipLocation ? WorkflowStep.SECOND_DESCRIPTION : WorkflowStep.SECOND_VOICE; } } @@ -9558,6 +9564,17 @@ export class RequestManagementService { const req = await this.blameRequestDbService.findById(requestId); if (!req) throw new NotFoundException("Request not found"); await this.verifyExpertAccessForBlameV2(req, actor); + + // V4/V5: location step is skipped — store whatever is sent but do not + // validate against workflow phase (the step was auto-completed at inquiry time). + if ((req as any).isMadeByFileMaker) { + const role = this.resolvePartyRoleV3(req, partyRole); + const idx = this.getPartyIndex(req, role); + if (idx !== -1 && body) req.parties[idx].location = body as any; + await (req as any).save(); + return { requestId: req._id, publicId: req.publicId, partyRole: role }; + } + const role = this.resolvePartyRoleV3(req, partyRole); this.assertBlameV3PartyDetailPhase(req, role);