forked from Yara724/api
Fixed v4 sign
This commit is contained in:
@@ -6187,27 +6187,41 @@ export class ClaimRequestManagementService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// V5 flow: FileMaker approval required before fanavaran.
|
// V5 flow: FileMaker approval required before fanavaran.
|
||||||
// Instead of submitting, hold the claim at WAITING_FOR_FILE_MAKER_APPROVAL.
|
// Cross-check the blame record — only V5 blame files carry requiresFileMakerApproval.
|
||||||
|
// V4 claims may have the flag set from an old bug; we ignore it if the blame
|
||||||
|
// itself does not carry the flag.
|
||||||
if ((claimCase as any).requiresFileMakerApproval) {
|
if ((claimCase as any).requiresFileMakerApproval) {
|
||||||
await this.claimCaseDbService.findByIdAndUpdate(claimCaseId, {
|
const blameId = (claimCase as any).blameRequestId;
|
||||||
$set: { status: ClaimCaseStatus.WAITING_FOR_FILE_MAKER_APPROVAL },
|
const blame = blameId
|
||||||
$push: {
|
? await this.blameRequestDbService.findById(String(blameId))
|
||||||
history: {
|
: null;
|
||||||
type: "V5_HELD_FOR_FILE_MAKER_APPROVAL",
|
const isV5 = !!(blame as any)?.requiresFileMakerApproval;
|
||||||
actor: { actorType: "system" },
|
|
||||||
timestamp: new Date(),
|
if (isV5) {
|
||||||
metadata: { claimCaseId },
|
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.",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// V4 claim with stale flag — clear it so this path is not hit again.
|
||||||
|
await this.claimCaseDbService.findByIdAndUpdate(claimCaseId, {
|
||||||
|
$unset: { requiresFileMakerApproval: "" },
|
||||||
});
|
});
|
||||||
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);
|
const skipReason = await this.getFanavaranAutoSubmitSkipReason(claimCase);
|
||||||
|
|||||||
Reference in New Issue
Block a user