forked from Yara724/api
Preserve damage history and current vehicle price, restore depreciation mapping, normalize inquiry/report output, and support resumable expert review with paginated case retrieval.
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
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("شماره شبا برای طرف زیاندیده الزامی است.");
|
|
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",
|
|
});
|
|
});
|
|
});
|