1
0
forked from Yara724/api

Fixed v2 mirror

This commit is contained in:
SepehrYahyaee
2026-07-20 11:44:50 +03:30
parent 4058cb4a61
commit 8460c86820

View File

@@ -278,6 +278,24 @@ export class RequestManagementService {
return; 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({ const submittedStep = await this.getWorkflowStep({
stepKey: submittedStepKey, stepKey: submittedStepKey,
}); });
@@ -299,8 +317,10 @@ export class RequestManagementService {
submittedStep.stepNumber + 1, submittedStep.stepNumber + 1,
); );
const nextStepKey = (sequentialNextStep?.stepKey ?? const nextStepKey = resolveStep(
submittedStep.nextPossibleSteps?.[0]) as WorkflowStep | undefined; (sequentialNextStep?.stepKey ??
submittedStep.nextPossibleSteps?.[0]) as WorkflowStep | undefined,
);
if (!nextStepKey) { if (!nextStepKey) {
// Terminal state: no more steps // Terminal state: no more steps
@@ -348,7 +368,7 @@ export class RequestManagementService {
nextStepDoc.nextPossibleSteps?.[0]) as WorkflowStep | undefined; nextStepDoc.nextPossibleSteps?.[0]) as WorkflowStep | undefined;
req.workflow.currentStep = nextStepKey; req.workflow.currentStep = nextStepKey;
req.workflow.nextStep = afterNextKey; req.workflow.nextStep = resolveStep(afterNextKey);
this.logger.debug( this.logger.debug(
`[WORKFLOW] Advanced to currentStep=${req.workflow.currentStep}, nextStep=${req.workflow.nextStep ?? "undefined"}`, `[WORKFLOW] Advanced to currentStep=${req.workflow.currentStep}, nextStep=${req.workflow.nextStep ?? "undefined"}`,