forked from Yara724/api
Fixed FileMaker and FileReviewer access to COMPLETED files
This commit is contained in:
@@ -8005,6 +8005,37 @@ export class ClaimRequestManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(actor?.role === RoleEnum.FILE_MAKER ||
|
||||
actor?.role === RoleEnum.FILE_REVIEWER) &&
|
||||
claim.blameRequestId
|
||||
) {
|
||||
const blame = await this.blameRequestDbService.findById(
|
||||
claim.blameRequestId.toString(),
|
||||
);
|
||||
const isV4OrV5File =
|
||||
!!(blame as any)?.isMadeByFileMaker &&
|
||||
blame?.expertInitiated &&
|
||||
blame?.creationMethod === "IN_PERSON";
|
||||
|
||||
if (
|
||||
actor.role === RoleEnum.FILE_MAKER &&
|
||||
isV4OrV5File &&
|
||||
claimCaseInitiatedByFieldExpert(claim, { sub: currentUserId }, blame)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
actor.role === RoleEnum.FILE_REVIEWER &&
|
||||
isV4OrV5File &&
|
||||
String((blame as any)?.assignedFileReviewerId ?? "") ===
|
||||
String(currentUserId)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (actor?.role === RoleEnum.REGISTRAR && claim.blameRequestId) {
|
||||
const blame = await this.blameRequestDbService.findById(
|
||||
claim.blameRequestId.toString(),
|
||||
@@ -11059,6 +11090,14 @@ export class ClaimRequestManagementService {
|
||||
carAngles,
|
||||
damagedParts,
|
||||
expertResend,
|
||||
fanavaran:
|
||||
claim.status === ClaimCaseStatus.COMPLETED &&
|
||||
(claim.claimNo != null || claim.claimId != null)
|
||||
? {
|
||||
claimNo: claim.claimNo,
|
||||
claimId: claim.claimId,
|
||||
}
|
||||
: undefined,
|
||||
evaluation: mappedEvaluation
|
||||
? {
|
||||
damageExpertReply: mappedEvaluation.damageExpertReply,
|
||||
|
||||
Reference in New Issue
Block a user