Fixed v4/v5 car capture flow

This commit is contained in:
SepehrYahyaee
2026-07-15 15:59:21 +03:30
parent 2fda740171
commit f39c50aeb0
3 changed files with 82 additions and 54 deletions

View File

@@ -51,8 +51,7 @@ import { GetCaptureRequirementsV2ResponseDto } from "src/claim-request-managemen
*
* The FileReviewer picks up a sealed file (both signatures collected by the
* FileMaker) and completes the damage-assessment portion: accident fields,
* documents, part selection, photo capture, walk-around video, and the final
* blame accident video that moves the file to WAITING_FOR_EXPERT.
* documents, part selection, photo capture, and walk-around video (final step).
*
* Sequence:
* accident-fields
@@ -61,9 +60,11 @@ import { GetCaptureRequirementsV2ResponseDto } from "src/claim-request-managemen
* → select-outer-parts
* → select-other-parts
* → capture-part (damaged-part photos + four angles)
* → upload-document (chassis / engine / metal plate — capture phase)
* → car-capture (walk-around video)
* → upload-video (blame accident video — final, moves to WAITING_FOR_EXPERT)
* → upload-document (chassis / engine — capture phase)
* → car-capture (walk-around video — FINAL FileReviewer step)
* ↳ claim → WAITING_FOR_DAMAGE_EXPERT, blame → COMPLETED
*
* NOTE: upload-video is a no-op for V4 (blame is already COMPLETED by car-capture).
*/
@ApiTags("v4 FileReviewer — blame file review & capture")
@Controller("v4/file-reviewer/blame-request-management")
@@ -341,9 +342,10 @@ export class FileReviewerBlameV4Controller {
},
})
@ApiOperation({
summary: "Walk-around video",
summary: "Walk-around video (final FileReviewer step — V4)",
description:
"Upload after capture-part is complete (parts, angles, capture-phase docs). Required before the final blame accident video.",
"Last FileReviewer action. Upload after capture-part is complete (parts, angles, chassis/engine docs). " +
"Finalises the claim → WAITING_FOR_DAMAGE_EXPERT and marks the blame as COMPLETED.",
})
async carCapture(
@Param("claimRequestId") claimRequestId: string,
@@ -384,10 +386,10 @@ export class FileReviewerBlameV4Controller {
@Post("upload-video/:requestId")
@ApiParam({ name: "requestId" })
@ApiOperation({
summary: "Blame accident video (FileReviewer final step — optional)",
summary: "Blame accident video (no-op for V4 — car-capture is the final step)",
description:
"Last step of the V4 flow. Requires claim walk-around video and completed capture. " +
"File is optional — omit it to complete the blame without attaching a video.",
"Deprecated for V4. The blame is already COMPLETED by car-capture. " +
"Calling this endpoint returns an idempotent success response.",
})
async uploadBlameVideo(
@Param("requestId") requestId: string,

View File

@@ -47,11 +47,9 @@ import {
import { GetCaptureRequirementsV2ResponseDto } from "src/claim-request-management/dto/capture-requirements-v2.dto";
/**
* V5 FileReviewer flow — same as V4 except the final blame accident video moves
* the file to WAITING_FOR_FINANCIAL_EXPERT instead of WAITING_FOR_EXPERT.
*
* A FinancialExpert must then approve the file (→ WAITING_FOR_EXPERT) or
* reject it back (→ FINANCIAL_EXPERT_REJECTED) for the FileReviewer to correct.
* V5 FileReviewer flow — same as V4 except after the damage expert completes
* their review, the claim goes to WAITING_FOR_FILE_MAKER_APPROVAL instead of
* being submitted directly to fanavaran.
*
* Sequence:
* accident-fields
@@ -60,9 +58,12 @@ import { GetCaptureRequirementsV2ResponseDto } from "src/claim-request-managemen
* → select-outer-parts
* → select-other-parts
* → capture-part (damaged-part photos + four angles)
* → upload-document (chassis / engine / metal plate — capture phase)
* → car-capture (walk-around video)
* → upload-video (blame accident video — final, moves to WAITING_FOR_FINANCIAL_EXPERT)
* → upload-document (chassis / engine — capture phase)
* → car-capture (walk-around video — FINAL FileReviewer step)
* ↳ claim → WAITING_FOR_DAMAGE_EXPERT, blame → COMPLETED
* ↳ after expert review: claim → WAITING_FOR_FILE_MAKER_APPROVAL
*
* NOTE: upload-video is a no-op for V5 (blame is already COMPLETED by car-capture).
*/
@ApiTags("v5 FileReviewer — blame file review & capture (with FinancialExpert approval)")
@Controller("v5/file-reviewer/blame-request-management")
@@ -340,9 +341,11 @@ export class FileReviewerBlameV5Controller {
},
})
@ApiOperation({
summary: "Walk-around video",
summary: "Walk-around video (final FileReviewer step — V5)",
description:
"Upload after capture-part is complete (parts, angles, capture-phase docs). Required before the final blame accident video.",
"Last FileReviewer action. Upload after capture-part is complete (parts, angles, chassis/engine docs). " +
"Finalises the claim → WAITING_FOR_DAMAGE_EXPERT and marks the blame as COMPLETED. " +
"After the damage expert review completes the claim moves to WAITING_FOR_FILE_MAKER_APPROVAL.",
})
async carCapture(
@Param("claimRequestId") claimRequestId: string,
@@ -360,7 +363,6 @@ export class FileReviewerBlameV5Controller {
// ─── Final blame video ─────────────────────────────────────────────────────────
//
// V5 difference: moves file to WAITING_FOR_FINANCIAL_EXPERT, not WAITING_FOR_EXPERT.
@ApiBody({
schema: {
@@ -385,10 +387,10 @@ export class FileReviewerBlameV5Controller {
@Post("upload-video/:requestId")
@ApiParam({ name: "requestId" })
@ApiOperation({
summary: "Blame accident video (FileReviewer final step — V5, optional)",
summary: "Blame accident video (no-op for V5 — car-capture is the final step)",
description:
"Last step of the V5 FileReviewer flow. Requires claim walk-around video and completed capture. " +
"File is optional — omit it to complete the blame without attaching a video.",
"Deprecated for V5. The blame is already COMPLETED by car-capture. " +
"Calling this endpoint returns an idempotent success response.",
})
async uploadBlameVideo(
@Param("requestId") requestId: string,