1
0
forked from Yara724/api

Fixed v4 sign

This commit is contained in:
SepehrYahyaee
2026-07-22 17:36:29 +03:30
parent 7a4277f8b2
commit f75ecf5c2c

View File

@@ -6187,8 +6187,17 @@ export class ClaimRequestManagementService {
}
// 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) {
const blameId = (claimCase as any).blameRequestId;
const blame = blameId
? await this.blameRequestDbService.findById(String(blameId))
: null;
const isV5 = !!(blame as any)?.requiresFileMakerApproval;
if (isV5) {
await this.claimCaseDbService.findByIdAndUpdate(claimCaseId, {
$set: { status: ClaimCaseStatus.WAITING_FOR_FILE_MAKER_APPROVAL },
$push: {
@@ -6209,6 +6218,11 @@ export class ClaimRequestManagementService {
"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: "" },
});
}
const skipReason = await this.getFanavaranAutoSubmitSkipReason(claimCase);
if (skipReason) {