Enforce claim beneficiary access and retire unused legacy APIs

This commit is contained in:
SepehrYahyaee
2026-10-05 14:39:51 +03:30
parent 0735333467
commit a3f9aab8fb
104 changed files with 6864 additions and 13223 deletions
@@ -39,7 +39,9 @@ describe("RequestManagementService FileReviewer inbox", () => {
find: jest.fn().mockResolvedValue([]),
};
(service as any).fanavaranLocationService = {
assertMakerReviewerBranchCompatible: jest.fn().mockResolvedValue(undefined),
assertMakerReviewerBranchCompatible: jest
.fn()
.mockResolvedValue(undefined),
};
return { service, blameRequestDbService };
}
@@ -94,10 +96,11 @@ describe("RequestManagementService FileReviewer inbox", () => {
it("does not list an open file from another branch", async () => {
const { service } = createService([sealedFile]);
(service as any).fanavaranLocationService
.assertMakerReviewerBranchCompatible.mockRejectedValue(
new Error("This file belongs to another branch."),
);
(
service as any
).fanavaranLocationService.assertMakerReviewerBranchCompatible.mockRejectedValue(
new Error("This file belongs to another branch."),
);
const result = await service.getMyFileReviewerFiles({
sub: String(reviewerId),
@@ -137,10 +140,12 @@ describe("RequestManagementService FileReviewer inbox", () => {
it("does not expose an open file's details to a reviewer from another tenant", async () => {
const { service } = createService([]);
(service as any).blameRequestDbService.findById = jest.fn().mockResolvedValue({
...sealedFile,
parties: [{ role: "FIRST", person: { clientId: otherClientId } }],
});
(service as any).blameRequestDbService.findById = jest
.fn()
.mockResolvedValue({
...sealedFile,
parties: [{ role: "FIRST", person: { clientId: otherClientId } }],
});
await expect(
service.getMyFileReviewerFileDetail(
@@ -225,16 +230,11 @@ describe("RequestManagementService FileReviewer inbox", () => {
}),
findOneAndUpdate: jest.fn(),
};
const expertClaimService = new (ExpertClaimService as any)(
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
blameRequestDbService,
const expertClaimService = Object.assign(
Object.create(ExpertClaimService.prototype),
{
blameRequestDbService,
},
) as ExpertClaimService;
await expect(