Fixed v4/v5 flow

This commit is contained in:
SepehrYahyaee
2026-07-22 17:22:27 +03:30
parent 2c1cd93dd0
commit 7a4277f8b2
3 changed files with 22 additions and 5 deletions

View File

@@ -4835,6 +4835,9 @@ export class RequestManagementService {
? FilledBy.EXPERT
: FilledBy.CUSTOMER,
...(isFileMakerRole ? { isMadeByFileMaker: true } : {}),
// V5 only: flag that causes the resulting claim to require FileMaker
// approval before fanavaran submission. V4 files never set this.
...(dto.requiresFileMakerApproval ? { requiresFileMakerApproval: true } : {}),
});
const requestId = String((created as any)._id);
@@ -8876,9 +8879,10 @@ export class RequestManagementService {
},
}
: {}),
// V5 (isMadeByFileMaker): mark approval gate at claim creation so the flag
// is always present regardless of whether upload-video is called.
...((req as any).isMadeByFileMaker
// V5 only: propagate the approval gate from the blame record to the claim.
// isMadeByFileMaker is true for both V4 and V5; only V5 blame records also
// carry requiresFileMakerApproval=true (set at create time by the V5 controller).
...((req as any).requiresFileMakerApproval
? {
requiresFileMakerApproval: true,
fileMakerApprovalActorId: new Types.ObjectId(actor.sub),