1
0
forked from Yara724/api
Files
yara724-api/src/fanavaran/fanavaran-lookup.config.ts
2026-07-01 18:05:09 +03:30

89 lines
2.7 KiB
TypeScript

import type { FanavaranClientKey } from "src/core/config/fanavaran-client.config";
export const FANAVARAN_LOOKUP_BASE_URL =
"https://apimanager.iraneit.com/BimeApiManager/api/BimeApi/v2.0";
export interface FanavaranRemoteLookupDefinition {
name: string;
url: string;
cacheFile: string;
}
/** Fanavaran API lookups synced per client (Parsian fetches on first call). */
export const FANAVARAN_REMOTE_LOOKUPS: FanavaranRemoteLookupDefinition[] = [
{
name: "accident-causes",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/base-info/accident-causes`,
cacheFile: "accident-causes.json",
},
{
name: "accident-report-type",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/accident-report-type`,
cacheFile: "accident-report-type.json",
},
{
name: "vehicle-use-types",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/base-info/vehicle-use-types`,
cacheFile: "vehicle-use-types.json",
},
{
name: "dmg-pay-method",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/dmg-pay-method`,
cacheFile: "dmg-pay-method.json",
},
{
name: "driving-licence-types",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/base-info/driving-licence-types`,
cacheFile: "driving-licence-types.json",
},
{
name: "accident-culprit-type",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/accident-culprit-type`,
cacheFile: "accident-culprit-type.json",
},
{
name: "inspection-place",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/inspection-place`,
cacheFile: "inspection-place.json",
},
{
name: "drop-amount-status",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/drop-amount-status`,
cacheFile: "drop-amount-status.json",
},
{
name: "car-components",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/base-info/car-components`,
cacheFile: "car-components.json",
},
{
name: "accident-level",
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/accident-level`,
cacheFile: "accident-level.json",
},
{
name: "expert-status",
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 = {
accidentReason: "ACCIDENT_REASON.json",
accidentWay: "ACCIDENT_WAY.json",
accidentType: "ACCIDENT_TYPE.json",
} as const;
export function fanavaranLookupCacheDir(clientKey: FanavaranClientKey): string {
return `${process.cwd()}/files/fanavaran-lookups/${clientKey}`;
}
export function tejaratStaticAccidentFilePath(fileName: string): string {
return `${process.cwd()}/src/static/${fileName}`;
}