forked from Yara724/api
fix inquiry integration and insurer case details
This commit is contained in:
@@ -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