forked from Yara724/api
Merge pull request 'Fixed v2 mirror' (#202) from s.yahyaee/yara724-api:main into main
Reviewed-on: Yara724/api#202
This commit is contained in:
@@ -278,6 +278,24 @@ export class RequestManagementService {
|
||||
return;
|
||||
}
|
||||
|
||||
// IN_PERSON THIRD_PARTY: guilt is decided on-site by the expert — there is
|
||||
// no waiting-for-field-expert phase. Replace WAITING_FOR_GUILT_DECISION
|
||||
// with WAITING_FOR_SIGNATURES wherever it would surface as current/next step.
|
||||
const isInPersonThirdParty =
|
||||
req.type === BlameRequestType.THIRD_PARTY &&
|
||||
req.creationMethod === CreationMethod.IN_PERSON &&
|
||||
(req.expertInitiated || req.registrarInitiated);
|
||||
|
||||
const resolveStep = (step: WorkflowStep | undefined): WorkflowStep | undefined => {
|
||||
if (
|
||||
isInPersonThirdParty &&
|
||||
step === WorkflowStep.WAITING_FOR_GUILT_DECISION
|
||||
) {
|
||||
return WorkflowStep.WAITING_FOR_SIGNATURES;
|
||||
}
|
||||
return step;
|
||||
};
|
||||
|
||||
const submittedStep = await this.getWorkflowStep({
|
||||
stepKey: submittedStepKey,
|
||||
});
|
||||
@@ -299,8 +317,10 @@ export class RequestManagementService {
|
||||
submittedStep.stepNumber + 1,
|
||||
);
|
||||
|
||||
const nextStepKey = (sequentialNextStep?.stepKey ??
|
||||
submittedStep.nextPossibleSteps?.[0]) as WorkflowStep | undefined;
|
||||
const nextStepKey = resolveStep(
|
||||
(sequentialNextStep?.stepKey ??
|
||||
submittedStep.nextPossibleSteps?.[0]) as WorkflowStep | undefined,
|
||||
);
|
||||
|
||||
if (!nextStepKey) {
|
||||
// Terminal state: no more steps
|
||||
@@ -348,7 +368,7 @@ export class RequestManagementService {
|
||||
nextStepDoc.nextPossibleSteps?.[0]) as WorkflowStep | undefined;
|
||||
|
||||
req.workflow.currentStep = nextStepKey;
|
||||
req.workflow.nextStep = afterNextKey;
|
||||
req.workflow.nextStep = resolveStep(afterNextKey);
|
||||
|
||||
this.logger.debug(
|
||||
`[WORKFLOW] Advanced to currentStep=${req.workflow.currentStep}, nextStep=${req.workflow.nextStep ?? "undefined"}`,
|
||||
|
||||
Reference in New Issue
Block a user