forked from Yara724/api
urls dynamic integration
This commit is contained in:
@@ -219,6 +219,7 @@ import { HttpService } from "@nestjs/axios";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
import {
|
||||
fanavaranSubmitPath,
|
||||
getFanavaranLookupBaseUrl,
|
||||
getFanavaranClientProfile,
|
||||
resolveFanavaranClientKey,
|
||||
resolveFanavaranProductContractId,
|
||||
@@ -228,10 +229,7 @@ import { buildEnrichedDamagedParts } from "src/expert-claim/dto/claim-damaged-pa
|
||||
import { FanavaranAuditService } from "src/fanavaran/fanavaran-audit.service";
|
||||
import type { FanavaranAuditSession } from "src/fanavaran/fanavaran-audit.types";
|
||||
import { FanavaranAuthService } from "src/fanavaran/fanavaran-auth.service";
|
||||
import {
|
||||
FANAVARAN_LOOKUP_BASE_URL,
|
||||
FANAVARAN_REMOTE_LOOKUPS,
|
||||
} from "src/fanavaran/fanavaran-lookup.config";
|
||||
import { FANAVARAN_REMOTE_LOOKUPS } from "src/fanavaran/fanavaran-lookup.config";
|
||||
import { FanavaranLookupService } from "src/fanavaran/fanavaran-lookup.service";
|
||||
import {
|
||||
FanavaranAuditSource,
|
||||
@@ -3306,6 +3304,7 @@ export class ClaimRequestManagementService {
|
||||
): Promise<string> {
|
||||
return fanavaranClaimsBaseUrl(
|
||||
await this.resolveFanavaranClaimProduct(claimCaseId, blameCase),
|
||||
resolveFanavaranClientKey(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3447,7 +3446,7 @@ export class ClaimRequestManagementService {
|
||||
(await this.resolveFanavaranClaimProduct(options?.claimCaseId));
|
||||
const insuranceLineId =
|
||||
options?.insuranceLineId ?? fanavaranInsuranceLineIdForProduct(product);
|
||||
const policyInquiryUrl = `https://apimanager.iraneit.com/BimeApiManager/api/BimeApi/v2.0/common/Policies/inquiry-my-policies?InsuranceLineId=${insuranceLineId}&NationalCode=${nationalCodeOfInsurer}`;
|
||||
const policyInquiryUrl = `${getFanavaranLookupBaseUrl(clientKey)}/common/Policies/inquiry-my-policies?InsuranceLineId=${insuranceLineId}&NationalCode=${nationalCodeOfInsurer}`;
|
||||
const startedAt = Date.now();
|
||||
|
||||
const requestMeta = {
|
||||
@@ -3821,7 +3820,7 @@ export class ClaimRequestManagementService {
|
||||
return null;
|
||||
}
|
||||
|
||||
const url = `${FANAVARAN_LOOKUP_BASE_URL}/common/other-people`;
|
||||
const url = `${getFanavaranLookupBaseUrl(clientKey)}/common/other-people`;
|
||||
const startedAt = Date.now();
|
||||
const auditSession: FanavaranAuditSession = {
|
||||
trackingCode: this.fanavaranAuditService.generateTrackingCode(),
|
||||
@@ -4533,7 +4532,12 @@ export class ClaimRequestManagementService {
|
||||
claimId: claimCase.claimId ?? null,
|
||||
dmgCaseId: claimCase.dmgCaseId ?? null,
|
||||
submitUrl: claimCase.claimId
|
||||
? fanavaranClaimStageUrl(product, "damage-case", claimCase.claimId)
|
||||
? fanavaranClaimStageUrl(
|
||||
product,
|
||||
"damage-case",
|
||||
claimCase.claimId,
|
||||
clientKey,
|
||||
)
|
||||
: null,
|
||||
warning: warnings.length ? warnings.join(" ") : undefined,
|
||||
payload,
|
||||
@@ -6111,7 +6115,7 @@ export class ClaimRequestManagementService {
|
||||
: built,
|
||||
clientKey,
|
||||
);
|
||||
const url = `${fanavaranClaimsBaseUrl("car-body")}/${nestedId}`;
|
||||
const url = `${fanavaranClaimsBaseUrl("car-body", clientKey)}/${nestedId}`;
|
||||
this.logger.log(
|
||||
`[Fanavaran hull sync] PUT ${url} keys=${Object.keys(hull).join(",")}`,
|
||||
);
|
||||
@@ -6248,6 +6252,7 @@ export class ClaimRequestManagementService {
|
||||
product,
|
||||
"damage-case",
|
||||
claimCase.claimId,
|
||||
clientKey,
|
||||
);
|
||||
if (url == null) {
|
||||
this.logger.log(
|
||||
|
||||
Reference in New Issue
Block a user