YARA-1169

This commit is contained in:
SepehrYahyaee
2026-08-16 10:18:43 +03:30
parent 7259eec949
commit 85d7881b2b
2 changed files with 48 additions and 2 deletions

View File

@@ -11374,6 +11374,7 @@ export class ClaimRequestManagementService {
step === ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS && step === ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS &&
capturePartDone capturePartDone
) { ) {
// car-capture not yet uploaded: next step is the walk-around video.
return { return {
...base, ...base,
requiredDocuments: [], requiredDocuments: [],
@@ -11384,6 +11385,22 @@ export class ClaimRequestManagementService {
}; };
} }
// V3 FIELD_EXPERT only: car-capture is done (step advanced to USER_SUBMISSION_COMPLETE
// in setVideoCaptureV3). The one remaining action is the blame accident video.
if (
step === ClaimWorkflowStep.USER_SUBMISSION_COMPLETE &&
!(blame as any).isMadeByFileMaker
) {
return {
...base,
requiredDocuments: [],
captureSequencePhase: "complete",
captureSequenceHint:
"Walk-around video uploaded. Upload the blame accident video to finalise.",
totalRemaining: 0,
};
}
return base; return base;
} }
@@ -11721,7 +11738,34 @@ export class ClaimRequestManagementService {
// V4/V5 only (isMadeByFileMaker): car-capture is the FINAL FileReviewer step. // V4/V5 only (isMadeByFileMaker): car-capture is the FINAL FileReviewer step.
// For the v3 mirror (FIELD_EXPERT IN_PERSON), car-capture is penultimate — // For the v3 mirror (FIELD_EXPERT IN_PERSON), car-capture is penultimate —
// expertUploadBlameVideoV3 finalises the blame with the accident video next. // expertUploadBlameVideoV3 finalises the blame with the accident video next.
if ((blame as any).isMadeByFileMaker) { // Advance the workflow step so that if the expert exits and reopens the claim
// the system correctly resumes at upload-video rather than replaying car-capture.
if (!(blame as any).isMadeByFileMaker) {
await this.claimCaseDbService.findByIdAndUpdate(claimRequestId, {
$set: {
"workflow.currentStep": ClaimWorkflowStep.USER_SUBMISSION_COMPLETE,
"workflow.nextStep": undefined,
},
$push: {
"workflow.completedSteps": ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
history: {
type: "STEP_COMPLETED",
actor: {
actorId: new Types.ObjectId(currentUserId),
actorName: claimCase.owner?.fullName || "User",
actorType: "field_expert",
},
timestamp: new Date(),
metadata: {
stepKey: ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
description:
"V3 walk-around video uploaded. Upload blame accident video to finalise.",
v3InPersonFlow: true,
},
},
},
});
} else if ((blame as any).isMadeByFileMaker) {
// Both V4 and V5 land at WAITING_FOR_DAMAGE_EXPERT here. // Both V4 and V5 land at WAITING_FOR_DAMAGE_EXPERT here.
// For V5 (requiresFileMakerApproval=true), autoSubmitToFanavaranV2OnClaimCompleted // For V5 (requiresFileMakerApproval=true), autoSubmitToFanavaranV2OnClaimCompleted
// intercepts COMPLETED → WAITING_FOR_FILE_MAKER_APPROVAL after expert review. // intercepts COMPLETED → WAITING_FOR_FILE_MAKER_APPROVAL after expert review.

View File

@@ -10049,7 +10049,9 @@ export class RequestManagementService {
} }
if ( if (
claim.workflow?.currentStep !== claim.workflow?.currentStep !==
ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS &&
claim.workflow?.currentStep !==
ClaimWorkflowStep.USER_SUBMISSION_COMPLETE
) { ) {
throw new BadRequestException( throw new BadRequestException(
"Complete capture-part (parts, angles, and capture-phase documents) before the blame accident video.", "Complete capture-part (parts, angles, and capture-phase documents) before the blame accident video.",