forked from Yara724/api
YARA-1110
This commit is contained in:
@@ -6167,6 +6167,30 @@ export class ClaimRequestManagementService {
|
||||
};
|
||||
}
|
||||
|
||||
// V5 flow: FileMaker approval required before fanavaran.
|
||||
// Instead of submitting, hold the claim at WAITING_FOR_FILE_MAKER_APPROVAL.
|
||||
if ((claimCase as any).requiresFileMakerApproval) {
|
||||
await this.claimCaseDbService.findByIdAndUpdate(claimCaseId, {
|
||||
$set: { status: ClaimCaseStatus.WAITING_FOR_FILE_MAKER_APPROVAL },
|
||||
$push: {
|
||||
history: {
|
||||
type: "V5_HELD_FOR_FILE_MAKER_APPROVAL",
|
||||
actor: { actorType: "system" },
|
||||
timestamp: new Date(),
|
||||
metadata: { claimCaseId },
|
||||
},
|
||||
},
|
||||
});
|
||||
return {
|
||||
attempted: false,
|
||||
submitted: false,
|
||||
skipped: true,
|
||||
skipReason:
|
||||
"V5 flow: FileMaker approval required before Fanavaran submission. " +
|
||||
"Claim is now in WAITING_FOR_FILE_MAKER_APPROVAL.",
|
||||
};
|
||||
}
|
||||
|
||||
const skipReason = await this.getFanavaranAutoSubmitSkipReason(claimCase);
|
||||
if (skipReason) {
|
||||
return {
|
||||
|
||||
@@ -242,6 +242,20 @@ export class ClaimCase {
|
||||
@Prop({ type: Types.ObjectId, index: true })
|
||||
createdByRegistrarId?: Types.ObjectId;
|
||||
|
||||
/**
|
||||
* V5 split flow: when true, the claim must be approved by the FileMaker
|
||||
* who created the file before fanavaran submission is allowed.
|
||||
*/
|
||||
@Prop({ type: Boolean, default: false })
|
||||
requiresFileMakerApproval?: boolean;
|
||||
|
||||
/**
|
||||
* V5 split flow: ObjectId of the FileMaker who must approve this claim.
|
||||
* Set when the FileReviewer uploads the blame accident video in the V5 flow.
|
||||
*/
|
||||
@Prop({ type: Types.ObjectId, index: true })
|
||||
fileMakerApprovalActorId?: Types.ObjectId;
|
||||
|
||||
/**
|
||||
* Legacy fields kept optional to simplify progressive migration.
|
||||
* If you choose to migrate later, we can remove these.
|
||||
|
||||
Reference in New Issue
Block a user