forked from Yara724/api
V4: add WAITING_FOR_FILE_REVIEWER claim status; fix select-outer-parts for split flow
- Add ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER (V4 split flow only) - Set claim status to WAITING_FOR_FILE_REVIEWER when FileMaker uploads the last required document (v3InPersonFlow path), replacing the old behaviour that incorrectly auto-advanced to SELECT_OUTER_PARTS - advanceV3ClaimToOuterPartsIfReady: also allow canAdvance when claimCase.status === WAITING_FOR_FILE_REVIEWER so the FileReviewer can call select-outer-parts after submitting accident fields - Add WAITING_FOR_FILE_REVIEWER to CLAIM_USER_PHASE (unified-file-status) so the file still resolves to IN_PROGRESS in the unified status report - Add WAITING_FOR_FILE_REVIEWER to CLAIM_IN_PROGRESS_STATUSES (expert-panel-status-report) for the expert report bucket - Add WAITING_FOR_FILE_REVIEWER to claimInHandling set (expert-insurer.service) so insurer stats count these correctly
This commit is contained in:
@@ -34,7 +34,15 @@ export enum ClaimCaseStatus {
|
|||||||
|
|
||||||
/** All required factor files are uploaded; damage expert validates factors (`UNDER_REVIEW` @ `EXPERT_COST_EVALUATION`). */
|
/** All required factor files are uploaded; damage expert validates factors (`UNDER_REVIEW` @ `EXPERT_COST_EVALUATION`). */
|
||||||
EXPERT_VALIDATING_REPAIR_FACTORS = "EXPERT_VALIDATING_REPAIR_FACTORS",
|
EXPERT_VALIDATING_REPAIR_FACTORS = "EXPERT_VALIDATING_REPAIR_FACTORS",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* V4 split flow only. FileMaker has uploaded all initial required documents;
|
||||||
|
* the file is sealed and waiting for a FileReviewer to pick it up (accident fields,
|
||||||
|
* capture, and final blame video). Transitions to SELECTING_OUTER_PARTS when the
|
||||||
|
* FileReviewer calls select-outer-parts after submitting accident fields.
|
||||||
|
*/
|
||||||
|
WAITING_FOR_FILE_REVIEWER = "WAITING_FOR_FILE_REVIEWER",
|
||||||
|
|
||||||
// Final states
|
// Final states
|
||||||
COMPLETED = "COMPLETED",
|
COMPLETED = "COMPLETED",
|
||||||
CANCELLED = "CANCELLED",
|
CANCELLED = "CANCELLED",
|
||||||
|
|||||||
@@ -8148,10 +8148,12 @@ export class ClaimRequestManagementService {
|
|||||||
|
|
||||||
if (allDocumentsUploaded) {
|
if (allDocumentsUploaded) {
|
||||||
if (options?.v3InPersonFlow) {
|
if (options?.v3InPersonFlow) {
|
||||||
$set["status"] = ClaimCaseStatus.SELECTING_OUTER_PARTS;
|
// V4 split flow: mark the claim as waiting for the FileReviewer.
|
||||||
$set["workflow.currentStep"] =
|
// The FileReviewer calls accident-fields then select-outer-parts, at
|
||||||
ClaimWorkflowStep.SELECT_OUTER_PARTS;
|
// which point advanceV3ClaimToOuterPartsIfReady() moves the claim to
|
||||||
$set["workflow.nextStep"] = ClaimWorkflowStep.SELECT_OTHER_PARTS;
|
// SELECTING_OUTER_PARTS / SELECT_OUTER_PARTS.
|
||||||
|
$set["status"] = ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER;
|
||||||
|
$set["workflow.nextStep"] = ClaimWorkflowStep.SELECT_OUTER_PARTS;
|
||||||
|
|
||||||
completedStepsEntries.push(
|
completedStepsEntries.push(
|
||||||
ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
||||||
@@ -8167,7 +8169,7 @@ export class ClaimRequestManagementService {
|
|||||||
metadata: {
|
metadata: {
|
||||||
stepKey: ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
stepKey: ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
||||||
description:
|
description:
|
||||||
"Initial required documents uploaded. Proceed to outer part selection.",
|
"FileMaker documents complete. File sealed — awaiting FileReviewer.",
|
||||||
v3InPersonFlow: true,
|
v3InPersonFlow: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -8283,7 +8285,7 @@ export class ClaimRequestManagementService {
|
|||||||
)
|
)
|
||||||
: allDocumentsUploaded
|
: allDocumentsUploaded
|
||||||
? options?.v3InPersonFlow
|
? options?.v3InPersonFlow
|
||||||
? "Initial required documents uploaded. Proceed to outer part selection."
|
? "All FileMaker documents uploaded. File is sealed and ready for FileReviewer pickup."
|
||||||
: "All documents uploaded successfully. Your claim is now ready for damage expert review."
|
: "All documents uploaded successfully. Your claim is now ready for damage expert review."
|
||||||
: `Document uploaded successfully. ${remaining} documents remaining.`;
|
: `Document uploaded successfully. ${remaining} documents remaining.`;
|
||||||
|
|
||||||
@@ -8298,7 +8300,7 @@ export class ClaimRequestManagementService {
|
|||||||
: ClaimWorkflowStep.CAPTURE_PART_DAMAGES
|
: ClaimWorkflowStep.CAPTURE_PART_DAMAGES
|
||||||
: allDocumentsUploaded
|
: allDocumentsUploaded
|
||||||
? options?.v3InPersonFlow
|
? options?.v3InPersonFlow
|
||||||
? ClaimWorkflowStep.SELECT_OUTER_PARTS
|
? ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS
|
||||||
: ClaimWorkflowStep.USER_SUBMISSION_COMPLETE
|
: ClaimWorkflowStep.USER_SUBMISSION_COMPLETE
|
||||||
: ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
: ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS,
|
||||||
message,
|
message,
|
||||||
@@ -9891,13 +9893,16 @@ export class ClaimRequestManagementService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const step = claimCase.workflow?.currentStep;
|
const step = claimCase.workflow?.currentStep;
|
||||||
// USER_SUBMISSION_COMPLETE can occur when documents were uploaded via a
|
// UPLOAD_REQUIRED_DOCUMENTS: normal V3/V4 path after FileMaker docs.
|
||||||
// non-V3 path (e.g. generic v2 endpoint). As long as accident fields are
|
// WAITING_FOR_FILE_REVIEWER (claim status): same DB step but with the new
|
||||||
// set (checked just below), it is safe to advance to SELECT_OUTER_PARTS.
|
// V4 claim status — FileReviewer is picking up the sealed file.
|
||||||
// The duplicate-selection guard lives in selectOuterPartsV2 itself.
|
// USER_SUBMISSION_COMPLETE: can occur when documents were uploaded via a
|
||||||
|
// non-V3 path (e.g. generic v2 endpoint). Safe to advance as long as
|
||||||
|
// accident fields are set (checked just below).
|
||||||
const canAdvance =
|
const canAdvance =
|
||||||
step === ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS ||
|
step === ClaimWorkflowStep.UPLOAD_REQUIRED_DOCUMENTS ||
|
||||||
step === ClaimWorkflowStep.USER_SUBMISSION_COMPLETE;
|
step === ClaimWorkflowStep.USER_SUBMISSION_COMPLETE ||
|
||||||
|
claimCase.status === ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER;
|
||||||
|
|
||||||
if (!canAdvance) {
|
if (!canAdvance) {
|
||||||
throw new BadRequestException(
|
throw new BadRequestException(
|
||||||
|
|||||||
@@ -1519,6 +1519,7 @@ export class ExpertInsurerService {
|
|||||||
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
||||||
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
||||||
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
||||||
|
ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER,
|
||||||
ClaimCaseStatus.WAITING_FOR_USER_RESEND,
|
ClaimCaseStatus.WAITING_FOR_USER_RESEND,
|
||||||
ClaimCaseStatus.WAITING_FOR_DAMAGE_EXPERT,
|
ClaimCaseStatus.WAITING_FOR_DAMAGE_EXPERT,
|
||||||
ClaimCaseStatus.EXPERT_REVIEWING,
|
ClaimCaseStatus.EXPERT_REVIEWING,
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ const CLAIM_IN_PROGRESS_STATUSES = new Set<string>([
|
|||||||
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
||||||
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
||||||
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
||||||
|
// V4 split flow: sealed by FileMaker, pending FileReviewer pickup.
|
||||||
|
ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function blameCaseStatusToReportBucket(status: string): string {
|
export function blameCaseStatusToReportBucket(status: string): string {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ const CLAIM_USER_PHASE = new Set<string>([
|
|||||||
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
||||||
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
ClaimCaseStatus.UPLOADING_REQUIRED_DOCUMENTS,
|
||||||
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
ClaimCaseStatus.CAPTURING_PART_DAMAGES,
|
||||||
|
// V4 split flow: FileMaker sealed the file; FileReviewer hasn't picked it up yet.
|
||||||
|
ClaimCaseStatus.WAITING_FOR_FILE_REVIEWER,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const INSURER_REVIEW_CLAIM_STATUSES = new Set<string>([
|
const INSURER_REVIEW_CLAIM_STATUSES = new Set<string>([
|
||||||
|
|||||||
Reference in New Issue
Block a user