forked from Yara724/api
fix it
This commit is contained in:
@@ -66,6 +66,11 @@ export const FANAVARAN_REMOTE_LOOKUPS: FanavaranRemoteLookupDefinition[] = [
|
||||
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/expert-status`,
|
||||
cacheFile: "expert-status.json",
|
||||
},
|
||||
{
|
||||
name: "vehicle-kinds",
|
||||
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/base-info/vehicle-kinds`,
|
||||
cacheFile: "vehicle-kinds.json",
|
||||
},
|
||||
];
|
||||
|
||||
export const TEJARAT_STATIC_ACCIDENT_FILES = {
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
type FanavaranClientKey,
|
||||
} from "src/core/config/fanavaran-client.config";
|
||||
import {
|
||||
FANAVARAN_LOOKUP_BASE_URL,
|
||||
fanavaranLookupCacheDir,
|
||||
tejaratStaticAccidentFilePath,
|
||||
} from "./fanavaran-lookup.config";
|
||||
@@ -246,6 +247,14 @@ export class FanavaranLookupService {
|
||||
}
|
||||
}
|
||||
|
||||
async inquiryByVin(
|
||||
clientKey: FanavaranClientKey,
|
||||
vin: string,
|
||||
): Promise<unknown> {
|
||||
const url = `${FANAVARAN_LOOKUP_BASE_URL}/car/vehicles/inquiry-by-vin?vin=${encodeURIComponent(vin)}`;
|
||||
return this.fetchFromFanavaran(clientKey, url);
|
||||
}
|
||||
|
||||
mapFanavaranAccidentCausesToReasonOptions(
|
||||
causes: unknown,
|
||||
): { id: number; label: string; fanavaran: number }[] {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
@@ -105,11 +106,13 @@ export class FanavaranController {
|
||||
async submit(
|
||||
@Param("client") client: string,
|
||||
@Param("claimCaseId") claimCaseId: string,
|
||||
@Body() body?: Record<string, unknown>,
|
||||
) {
|
||||
const clientKey = this.parseClientParam(client);
|
||||
return await this.claimRequestManagementService.submitFanavaranV2(
|
||||
claimCaseId,
|
||||
clientKey,
|
||||
body && Object.keys(body).length > 0 ? body : undefined,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -157,11 +160,13 @@ export class FanavaranController {
|
||||
async submitDamageCase(
|
||||
@Param("client") client: string,
|
||||
@Param("claimCaseId") claimCaseId: string,
|
||||
@Body() body?: Record<string, unknown>,
|
||||
) {
|
||||
const clientKey = this.parseClientParam(client);
|
||||
return await this.claimRequestManagementService.submitFanavaranDamageCaseV2(
|
||||
claimCaseId,
|
||||
clientKey,
|
||||
body && Object.keys(body).length > 0 ? body : undefined,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -261,11 +266,13 @@ export class FanavaranController {
|
||||
async submitExpertise(
|
||||
@Param("client") client: string,
|
||||
@Param("claimCaseId") claimCaseId: string,
|
||||
@Body() body?: Record<string, unknown>,
|
||||
) {
|
||||
const clientKey = this.parseClientParam(client);
|
||||
return await this.claimRequestManagementService.submitFanavaranExpertiseV2(
|
||||
claimCaseId,
|
||||
clientKey,
|
||||
body && Object.keys(body).length > 0 ? body : undefined,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user