forked from Yara724/api
Fixed reviewer flow
This commit is contained in:
@@ -770,7 +770,9 @@ export class ExpertBlameService {
|
||||
"",
|
||||
},
|
||||
needsFileReviewerCompletion:
|
||||
String(doc.status ?? "") === CaseStatus.WAITING_FOR_FILE_REVIEWER,
|
||||
String(doc.status ?? "") === CaseStatus.WAITING_FOR_FILE_REVIEWER ||
|
||||
(!!(doc as any).isMadeByFileMaker &&
|
||||
String(doc.status ?? "") === CaseStatus.WAITING_FOR_EXPERT),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import { ResendRequestDto } from "./dto/resend.dto";
|
||||
@Controller("v2/expert-blame")
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
||||
@Roles(RoleEnum.EXPERT, RoleEnum.FIELD_EXPERT, RoleEnum.FILE_REVIEWER, RoleEnum.FILE_MAKER)
|
||||
@Roles(RoleEnum.EXPERT, RoleEnum.FIELD_EXPERT)
|
||||
export class ExpertBlameV2Controller {
|
||||
constructor(private readonly expertBlameService: ExpertBlameService) {}
|
||||
|
||||
|
||||
@@ -3891,7 +3891,7 @@ export class ExpertClaimService {
|
||||
blameIds.length > 0
|
||||
? ((await this.blameRequestDbService.find(
|
||||
{ _id: { $in: blameIds.map((id) => new Types.ObjectId(id)) } },
|
||||
{ lean: true, select: "type parties expert.decision blameStatus" },
|
||||
{ lean: true, select: "type parties expert.decision blameStatus status isMadeByFileMaker" },
|
||||
)) as any[])
|
||||
: [];
|
||||
const blameById = new Map<string, any>(
|
||||
@@ -4027,7 +4027,9 @@ export class ExpertClaimService {
|
||||
createdAt: c.createdAt,
|
||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||
needsFileReviewerCompletion:
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER",
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER" ||
|
||||
(!!blame?.isMadeByFileMaker &&
|
||||
String(blame?.status ?? "") === "WAITING_FOR_EXPERT"),
|
||||
};
|
||||
}) as ClaimListItemV2Dto[];
|
||||
|
||||
@@ -4140,7 +4142,9 @@ export class ExpertClaimService {
|
||||
createdAt: c.createdAt,
|
||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||
needsFileReviewerCompletion:
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER",
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER" ||
|
||||
(!!blame?.isMadeByFileMaker &&
|
||||
String(blame?.status ?? "") === "WAITING_FOR_EXPERT"),
|
||||
assignedToMe: !!assignedToMe,
|
||||
};
|
||||
}) as ClaimListItemV2Dto[];
|
||||
@@ -4212,7 +4216,9 @@ export class ExpertClaimService {
|
||||
createdAt: c.createdAt,
|
||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||
needsFileReviewerCompletion:
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER",
|
||||
String(blame?.status ?? "") === "WAITING_FOR_FILE_REVIEWER" ||
|
||||
(!!blame?.isMadeByFileMaker &&
|
||||
String(blame?.status ?? "") === "WAITING_FOR_EXPERT"),
|
||||
assignedFileReviewerId: blame?.assignedFileReviewerId
|
||||
? String(blame.assignedFileReviewerId)
|
||||
: undefined,
|
||||
|
||||
Reference in New Issue
Block a user