forked from Yara724/api
fix inquiry integration and insurer case details
This commit is contained in:
@@ -189,7 +189,7 @@ describe("SandHubService inquiry mocks", () => {
|
||||
},
|
||||
});
|
||||
|
||||
const result = await service.getPolicyByChassisInquiry({
|
||||
const result = await service.getCarByChassisInquiry({
|
||||
nationalCode: "0012345678",
|
||||
chassis: "NAAR03HFFRDE07024",
|
||||
});
|
||||
@@ -239,7 +239,7 @@ describe("SandHubService inquiry mocks", () => {
|
||||
});
|
||||
|
||||
await expect(
|
||||
service.getPolicyByChassisInquiry(
|
||||
service.getCarByChassisInquiry(
|
||||
{
|
||||
nationalCode: "1234567890",
|
||||
chassis: "NAAR03HFFRDE07024",
|
||||
@@ -256,13 +256,13 @@ describe("SandHubService inquiry mocks", () => {
|
||||
data: { CmpCod: "8", CmpNam: "بیمه پارسیان" },
|
||||
});
|
||||
|
||||
await service.getPolicyByChassisInquiry({
|
||||
await service.getCarByChassisInquiry({
|
||||
nationalCode: "0012345678",
|
||||
chassis: "NAAR03HFFRDE07024",
|
||||
});
|
||||
|
||||
expect(esg).toHaveBeenCalledWith(
|
||||
expect.stringContaining("/inquiry/policyByChassis"),
|
||||
expect.stringContaining("/inquiry/carByChassis"),
|
||||
{
|
||||
nationalCode: "0012345678",
|
||||
chassis: "NAAR03HFFRDE07024",
|
||||
|
||||
@@ -1187,7 +1187,7 @@ export class SandHubService {
|
||||
}
|
||||
|
||||
/**
|
||||
* ESG VIN/chassis-number inquiry (`/inquiry/policyByChassis`).
|
||||
* ESG two-factor VIN/chassis inquiry (`/inquiry/carByChassis`).
|
||||
*
|
||||
* When `vinChassis` inquiry is disabled (mock mode) the response shape mirrors
|
||||
* `buildMockPlateInquiryRaw` so the downstream mapper (`mapEsgPolicyByPlateToOldFormat`)
|
||||
@@ -1196,12 +1196,12 @@ export class SandHubService {
|
||||
* @param identity - policyholder national code and 17-character VIN/chassis
|
||||
* @param options - optional per-tenant client scope
|
||||
*/
|
||||
async getPolicyByChassisInquiry(
|
||||
async getCarByChassisInquiry(
|
||||
identity: { nationalCode: string; chassis: string },
|
||||
options?: SandHubInquiryOptions,
|
||||
): Promise<{ raw: any; mapped: any }> {
|
||||
const baseUrl = process.env.ESG_URL ?? "http://192.168.20.22:8085";
|
||||
const requestUrl = `${baseUrl}/inquiry/policyByChassis`;
|
||||
const requestUrl = `${baseUrl}/inquiry/carByChassis`;
|
||||
const requestPayload = {
|
||||
nationalCode: String(identity.nationalCode),
|
||||
chassis: String(identity.chassis),
|
||||
@@ -1213,7 +1213,7 @@ export class SandHubService {
|
||||
const ctx = await this.mockCompanyContext(options);
|
||||
const raw = this.buildMockPlateInquiryRaw(ctx);
|
||||
this.logger.debug(
|
||||
`[MOCK] getPolicyByChassisInquiry nationalCode=${identity.nationalCode} chassis=${identity.chassis}`,
|
||||
`[MOCK] getCarByChassisInquiry nationalCode=${identity.nationalCode} chassis=${identity.chassis}`,
|
||||
);
|
||||
const mapped = this.mapEsgPolicyByPlateToOldFormat(raw, "thirdPartyVin");
|
||||
if (!mapped?.Error) {
|
||||
|
||||
Reference in New Issue
Block a user