forked from Yara724/api
fixed branch being mandatory
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user