Fixed Participants

This commit is contained in:
SepehrYahyaee
2026-09-14 14:27:23 +03:30
parent 51166a8d0d
commit 9930e9ff5b
13 changed files with 518 additions and 199 deletions

View File

@@ -0,0 +1,44 @@
import { RequestManagementService } from "./request-management.service";
describe("damaged-party inquiry requirements", () => {
const getService = () => {
const service = Object.create(
RequestManagementService.prototype,
) as RequestManagementService;
(service as any).sandHubService = {
getShebaValidation: jest.fn().mockResolvedValue({ valid: true }),
};
return service;
};
it("requires Sheba when the claimant/damaged-party validation runs", async () => {
const service = getService();
await expect(
(service as any).validateShebaV3(
undefined,
"0012345678",
"client-id",
),
).rejects.toThrow("sheba is required for the damaged party.");
expect(
(service as any).sandHubService.getShebaValidation,
).not.toHaveBeenCalled();
});
it("validates damaged-party Sheba against the vehicle owner's national code", async () => {
const service = getService();
await (service as any).validateShebaV3(
"IR123456789012345678901234",
"0012345678",
"client-id",
);
expect(
(service as any).sandHubService.getShebaValidation,
).toHaveBeenCalledWith("0012345678", "IR123456789012345678901234", {
clientId: "client-id",
});
});
});