forked from Yara724/api
YARA-1267, YARA-1268
This commit is contained in:
@@ -931,7 +931,31 @@ export class SandHubService {
|
||||
raw: any;
|
||||
mapped: Record<string, unknown>;
|
||||
}> {
|
||||
if (!this.shouldUseParsianCarBodyLookup()) {
|
||||
const useParsianCarBodyLookup = this.shouldUseParsianCarBodyLookup();
|
||||
const live = await this.isInquiryLive("carBodyPlate", options);
|
||||
|
||||
if (!live) {
|
||||
// Mock results are generated for the active deployment. They must not be
|
||||
// treated as evidence of a real insurer and therefore do not go through
|
||||
// the live-policy insurer gate.
|
||||
const result = await this.getTejaratCarBodyInquiry(
|
||||
userDetail as SandHubDetailDto,
|
||||
options,
|
||||
);
|
||||
return {
|
||||
source:
|
||||
typeof userDetail.plate === "string"
|
||||
? useParsianCarBodyLookup
|
||||
? "ESG_CAR_BODY_VIN_INQUIRY"
|
||||
: "TEJARAT_CAR_BODY_VIN_INQUIRY"
|
||||
: useParsianCarBodyLookup
|
||||
? "ESG_CAR_BODY_INQUIRY"
|
||||
: "TEJARAT_CAR_BODY_INQUIRY",
|
||||
...result,
|
||||
};
|
||||
}
|
||||
|
||||
if (!useParsianCarBodyLookup) {
|
||||
const result = await this.getTejaratCarBodyInquiry(
|
||||
userDetail as SandHubDetailDto,
|
||||
options,
|
||||
@@ -946,23 +970,6 @@ export class SandHubService {
|
||||
};
|
||||
}
|
||||
|
||||
const live = await this.isInquiryLive("carBodyPlate", options);
|
||||
if (!live) {
|
||||
// Reuse the established local mock contract without sending an HTTP request.
|
||||
const result = await this.getTejaratCarBodyInquiry(
|
||||
userDetail as SandHubDetailDto,
|
||||
options,
|
||||
);
|
||||
this.assertParsianCarBodyLookupMatchesDeployment();
|
||||
return {
|
||||
source:
|
||||
typeof userDetail.plate === "string"
|
||||
? "ESG_CAR_BODY_VIN_INQUIRY"
|
||||
: "ESG_CAR_BODY_INQUIRY",
|
||||
...result,
|
||||
};
|
||||
}
|
||||
|
||||
const plateOrVin = userDetail.plate;
|
||||
const query =
|
||||
typeof plateOrVin === "string"
|
||||
|
||||
Reference in New Issue
Block a user