fixed branch being mandatory

This commit is contained in:
SepehrYahyaee
2026-09-12 10:18:17 +03:30
parent 55da8188a9
commit ebe45646c1
7 changed files with 209 additions and 1 deletions

View File

@@ -104,6 +104,69 @@ describe("RequestManagementService FileReviewer inbox", () => {
).rejects.toThrow("does not belong to your organization");
});
it("returns party identity, VIN plate and claim payment/reference data to the V4 reviewer", async () => {
const { service } = createService([]);
const request = {
...sealedFile,
parties: [
{
role: "FIRST",
person: {
clientId,
fullName: "راننده و بیمه‌گذار نمونه",
nationalCodeOfInsurer: "1111111111",
nationalCodeOfDriver: "2222222222",
driverIsInsurer: false,
licenseType: "پایه یک",
driverLicense: "L-123",
},
vehicle: { plateId: "11-22-ب-333", vin: "VIN-123" },
},
],
};
(service as any).blameRequestDbService.findById = jest
.fn()
.mockResolvedValue(request);
(service as any).claimCaseDbService = {
findOne: jest.fn().mockResolvedValue({
_id: new Types.ObjectId(),
status: "COMPLETED",
workflow: {},
money: { sheba: "IR123" },
claimId: 101,
fanavaranSync: { baseClaim: { policyId: 202 } },
}),
};
const result = await service.getMyFileReviewerFileDetail(
{
sub: String(reviewerId),
role: RoleEnum.FILE_REVIEWER,
clientKey: String(clientId),
},
String(sealedFile._id),
);
expect(result.parties[0]).toEqual(
expect.objectContaining({
person: expect.objectContaining({
fullName: "راننده و بیمه‌گذار نمونه",
nationalCodeOfInsurer: "1111111111",
nationalCodeOfDriver: "2222222222",
licenseType: "پایه یک",
}),
vehicle: expect.objectContaining({
plateId: "11-22-ب-333",
vin: "VIN-123",
}),
}),
);
expect(result.money).toEqual({ sheba: "IR123" });
expect(result.fanavaran).toEqual(
expect.objectContaining({ claimId: 101, policyId: 202 }),
);
});
it("does not let a reviewer claim another tenant's file through its linked claim ID", async () => {
const blameRequestDbService = {
findById: jest.fn().mockResolvedValue({