1
0
forked from Yara724/api

YARA-1115

This commit is contained in:
SepehrYahyaee
2026-07-14 11:23:39 +03:30
parent 6387ebaed0
commit 36a34e27b3

View File

@@ -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);