forked from Yara724/api
Merge pull request 'Fixed reviewer flow' (#175) from s.yahyaee/yara724-api:main into main
Reviewed-on: Yara724/api#175
This commit is contained in:
@@ -770,7 +770,9 @@ export class ExpertBlameService {
|
|||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
needsFileReviewerCompletion:
|
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")
|
@Controller("v2/expert-blame")
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
||||||
@Roles(RoleEnum.EXPERT, RoleEnum.FIELD_EXPERT, RoleEnum.FILE_REVIEWER, RoleEnum.FILE_MAKER)
|
@Roles(RoleEnum.EXPERT, RoleEnum.FIELD_EXPERT)
|
||||||
export class ExpertBlameV2Controller {
|
export class ExpertBlameV2Controller {
|
||||||
constructor(private readonly expertBlameService: ExpertBlameService) {}
|
constructor(private readonly expertBlameService: ExpertBlameService) {}
|
||||||
|
|
||||||
|
|||||||
@@ -3891,7 +3891,7 @@ export class ExpertClaimService {
|
|||||||
blameIds.length > 0
|
blameIds.length > 0
|
||||||
? ((await this.blameRequestDbService.find(
|
? ((await this.blameRequestDbService.find(
|
||||||
{ _id: { $in: blameIds.map((id) => new Types.ObjectId(id)) } },
|
{ _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[])
|
)) as any[])
|
||||||
: [];
|
: [];
|
||||||
const blameById = new Map<string, any>(
|
const blameById = new Map<string, any>(
|
||||||
@@ -4027,7 +4027,9 @@ export class ExpertClaimService {
|
|||||||
createdAt: c.createdAt,
|
createdAt: c.createdAt,
|
||||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||||
needsFileReviewerCompletion:
|
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[];
|
}) as ClaimListItemV2Dto[];
|
||||||
|
|
||||||
@@ -4140,7 +4142,9 @@ export class ExpertClaimService {
|
|||||||
createdAt: c.createdAt,
|
createdAt: c.createdAt,
|
||||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||||
needsFileReviewerCompletion:
|
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,
|
assignedToMe: !!assignedToMe,
|
||||||
};
|
};
|
||||||
}) as ClaimListItemV2Dto[];
|
}) as ClaimListItemV2Dto[];
|
||||||
@@ -4212,7 +4216,9 @@ export class ExpertClaimService {
|
|||||||
createdAt: c.createdAt,
|
createdAt: c.createdAt,
|
||||||
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
awaitingFactorValidation: claimIsAwaitingExpertFactorValidationV2(c),
|
||||||
needsFileReviewerCompletion:
|
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
|
assignedFileReviewerId: blame?.assignedFileReviewerId
|
||||||
? String(blame.assignedFileReviewerId)
|
? String(blame.assignedFileReviewerId)
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user