forked from Yara724/api
urls dynamic integration
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { BlameRequestType } from "src/Types&Enums/blame-request-management/blameRequestType.enum";
|
||||
import { PartyRole } from "src/request-management/entities/schema/partyRole.enum";
|
||||
import {
|
||||
getFanavaranLookupBaseUrl,
|
||||
resolveFanavaranClientKey,
|
||||
type FanavaranClientKey,
|
||||
} from "src/core/config/fanavaran-client.config";
|
||||
import {
|
||||
FANAVARAN_CAR_BODY_LINE_ID,
|
||||
FANAVARAN_THIRD_PARTY_LINE_ID,
|
||||
@@ -12,9 +17,6 @@ import type { InquiryParticipantRoleAssignments } from "src/request-management/i
|
||||
|
||||
export type FanavaranClaimProduct = FanavaranCarPolicyProduct;
|
||||
|
||||
const FANAVARAN_CLAIMS_HOST =
|
||||
"https://apimanager.iraneit.com/BimeApiManager/api/BimeApi/v2.0/car";
|
||||
|
||||
export function fanavaranClaimProductFromBlameType(
|
||||
type?: string | null,
|
||||
): FanavaranClaimProduct {
|
||||
@@ -44,8 +46,9 @@ export function fanavaranClaimsResourcePath(
|
||||
|
||||
export function fanavaranClaimsBaseUrl(
|
||||
product: FanavaranClaimProduct,
|
||||
clientKey: FanavaranClientKey = resolveFanavaranClientKey(),
|
||||
): string {
|
||||
return `${FANAVARAN_CLAIMS_HOST}/${fanavaranClaimsResourcePath(product)}`;
|
||||
return `${getFanavaranLookupBaseUrl(clientKey)}/car/${fanavaranClaimsResourcePath(product)}`;
|
||||
}
|
||||
|
||||
export type FanavaranClaimStage =
|
||||
@@ -66,14 +69,17 @@ export function fanavaranHasDamageCaseStage(
|
||||
return product === "third-party";
|
||||
}
|
||||
|
||||
export function fanavaranHullImportClaimsUrl(): string {
|
||||
return `${FANAVARAN_CLAIMS_HOST}/${FANAVARAN_HULL_IMPORT_CLAIMS_PATH}`;
|
||||
export function fanavaranHullImportClaimsUrl(
|
||||
clientKey: FanavaranClientKey = resolveFanavaranClientKey(),
|
||||
): string {
|
||||
return `${getFanavaranLookupBaseUrl(clientKey)}/car/${FANAVARAN_HULL_IMPORT_CLAIMS_PATH}`;
|
||||
}
|
||||
|
||||
export function fanavaranClaimStageUrl(
|
||||
product: FanavaranClaimProduct,
|
||||
stage: FanavaranClaimStage,
|
||||
claimId: number | string,
|
||||
clientKey: FanavaranClientKey = resolveFanavaranClientKey(),
|
||||
): string | null {
|
||||
if (stage === "damage-case" && !fanavaranHasDamageCaseStage(product)) {
|
||||
return null;
|
||||
@@ -89,7 +95,7 @@ export function fanavaranClaimStageUrl(
|
||||
: stage === "culprits"
|
||||
? "culprits"
|
||||
: "expertise";
|
||||
return `${fanavaranClaimsBaseUrl(product)}/${claimId}/${suffix}`;
|
||||
return `${fanavaranClaimsBaseUrl(product, clientKey)}/${claimId}/${suffix}`;
|
||||
}
|
||||
|
||||
export function fanavaranInsuranceLineIdForProduct(
|
||||
|
||||
Reference in New Issue
Block a user