forked from Yara724/api
fix inquiry integration and insurer case details
This commit is contained in:
@@ -465,7 +465,7 @@ export class RequestManagementService {
|
||||
);
|
||||
}
|
||||
const subjects = resolveInquirySubjects(submission);
|
||||
const result = await this.sandHubService.getPolicyByChassisInquiry(
|
||||
const result = await this.sandHubService.getCarByChassisInquiry(
|
||||
{
|
||||
nationalCode: subjects.thirdPartyPolicyNationalCode,
|
||||
chassis,
|
||||
@@ -2142,7 +2142,7 @@ export class RequestManagementService {
|
||||
* V2 initial-form submitted with a VIN/chassis number instead of a plate.
|
||||
*
|
||||
* Performs:
|
||||
* 1. ESG `/inquiry/policyByChassis` (or its mock when `vinChassis` is off)
|
||||
* 1. ESG two-factor `/inquiry/carByChassis` (or its mock when `vinChassis` is off)
|
||||
* 2. Personal identity inquiry (same as the plate path)
|
||||
*
|
||||
* The inquiry result is mapped through the same `mapEsgPolicyByPlateToOldFormat`
|
||||
@@ -2236,7 +2236,7 @@ export class RequestManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- External inquiry: ESG policyByChassis ----
|
||||
// ---- External inquiry: ESG two-factor carByChassis ----
|
||||
const inquiryClientId = party.person?.clientId
|
||||
? String(party.person.clientId)
|
||||
: undefined;
|
||||
@@ -2256,10 +2256,10 @@ export class RequestManagementService {
|
||||
inquiryRaw = inquiry.raw;
|
||||
inquiryMapped = inquiry.mapped;
|
||||
this.logger.log(
|
||||
`[ESG] policyByChassis raw for request=${req._id}: ${JSON.stringify(inquiryRaw)}`,
|
||||
`[ESG] carByChassis raw for request=${req._id}: ${JSON.stringify(inquiryRaw)}`,
|
||||
);
|
||||
this.logger.log(
|
||||
`[ESG] policyByChassis mapped for request=${req._id}: ${JSON.stringify(inquiryMapped)}`,
|
||||
`[ESG] carByChassis mapped for request=${req._id}: ${JSON.stringify(inquiryMapped)}`,
|
||||
);
|
||||
this.recordPartyCaseInquiryStatus(
|
||||
req,
|
||||
@@ -2274,11 +2274,11 @@ export class RequestManagementService {
|
||||
);
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
`[ESG] policyByChassis failed for request=${req._id}: ${err?.message || err}`,
|
||||
`[ESG] carByChassis failed for request=${req._id}: ${err?.message || err}`,
|
||||
);
|
||||
if (err?.response) {
|
||||
this.logger.error(
|
||||
`[ESG] policyByChassis response for request=${req._id}: status=${
|
||||
`[ESG] carByChassis response for request=${req._id}: status=${
|
||||
err.response.status
|
||||
}, data=${JSON.stringify(err.response.data)}`,
|
||||
);
|
||||
@@ -2300,7 +2300,7 @@ export class RequestManagementService {
|
||||
|
||||
if (inquiryMapped?.Error) {
|
||||
this.logger.warn(
|
||||
`[ESG] policyByChassis error for request=${req._id}: ${JSON.stringify(inquiryMapped.Error)}`,
|
||||
`[ESG] carByChassis error for request=${req._id}: ${JSON.stringify(inquiryMapped.Error)}`,
|
||||
);
|
||||
this.recordPartyCaseInquiryStatus(req, "thirdParty", role, false, {
|
||||
source: "ESG_VIN_INQUIRY",
|
||||
@@ -10645,7 +10645,7 @@ export class RequestManagementService {
|
||||
|
||||
/**
|
||||
* VIN variant of `runInquiriesV3`.
|
||||
* Identical flow, but calls `getPolicyByChassisInquiry` instead of
|
||||
* Identical flow, but calls the two-factor `getCarByChassisInquiry` instead of
|
||||
* `getTejaratBlockInquiry` for the primary policy lookup.
|
||||
*/
|
||||
async runInquiriesVinV3(
|
||||
@@ -10788,7 +10788,7 @@ export class RequestManagementService {
|
||||
|
||||
/**
|
||||
* VIN variant of `runPartyInquiriesV3Internal`.
|
||||
* Calls `getPolicyByChassisInquiry` (ESG chassis lookup) instead of
|
||||
* Calls `getCarByChassisInquiry` (ESG two-factor chassis lookup) instead of
|
||||
* `getTejaratBlockInquiry` (plate-based). All other inquiries (personal,
|
||||
* driving licence, car-body for CAR_BODY) are unchanged.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user