forked from Yara724/api
Merge pull request 'main' (#258) from s.hajizadeh/yara724api:main into main
Reviewed-on: Yara724/api#258
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# YARA724 API
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Fanavaran integration](docs/fanavaran/README.md)
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
last_updated: 2026-08-08
|
||||
last_updated: 2026-08-09
|
||||
tags: [fanavaran, api, read, lookups]
|
||||
source: fanavaran-module-docs
|
||||
---
|
||||
@@ -16,7 +16,20 @@ files/fanavaran-lookups/{clientKey}/
|
||||
|
||||
Config: `src/fanavaran/fanavaran-lookup.config.ts`
|
||||
Service: `FanavaranLookupService`
|
||||
Local HTTP: `LookupsController` / `LookupsService`
|
||||
Local HTTP: `LookupsController` / `LookupsService` (`src/lookups/`)
|
||||
|
||||
Fanavaran base (docs often call this **BaseURL1**):
|
||||
|
||||
```text
|
||||
https://apimanager.iraneit.com/BimeApiManager/api/BimeApi/v2.0
|
||||
```
|
||||
|
||||
Example catalogue URL:
|
||||
|
||||
```text
|
||||
{BaseURL1}/car/base-info/driving-licence-types
|
||||
→ YARA: GET /lookups/driving-licence-types
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -94,15 +107,54 @@ Lists / fetches by name for the **active** `FANAVARAN_CLIENT`.
|
||||
|
||||
---
|
||||
|
||||
## 4. Other read helpers (LookupsController)
|
||||
## 4. Lookups module — Nest routes (`LookupsController`)
|
||||
|
||||
| Route | Purpose |
|
||||
|-------|---------|
|
||||
| `GET /lookups/inquiry-by-vin` | VIN inquiry via Fanavaran |
|
||||
| `GET /lookups/my-policies` | Policies for national code |
|
||||
| `GET /lookups/third-party-policy/:policyId` | Policy by id |
|
||||
| `GET /lookups/body-policy/:policyId` | Body policy by id |
|
||||
| `GET /lookups/accident-reason\|way\|type\|fields` | UI accident fields (Tejarat static + Fanavaran map) |
|
||||
Auth: Bearer + `AuthGuard`. Active tenant from `FANAVARAN_CLIENT` / `CLIENT_ID`.
|
||||
|
||||
### 4.1 Cached Fanavaran catalogue (dedicated routes)
|
||||
|
||||
| Nest route | Fanavaran path |
|
||||
|------------|----------------|
|
||||
| `GET /lookups/accident-causes` | `/car/base-info/accident-causes` |
|
||||
| `GET /lookups/accident-report-type` | `/car/code-list/accident-report-type` |
|
||||
| `GET /lookups/vehicle-use-types` | `/car/base-info/vehicle-use-types` |
|
||||
| `GET /lookups/dmg-pay-method` | `/car/code-list/dmg-pay-method` |
|
||||
| `GET /lookups/driving-licence-types` | `/car/base-info/driving-licence-types` |
|
||||
| `GET /lookups/accident-culprit-type` | `/car/code-list/accident-culprit-type` |
|
||||
| `GET /lookups/inspection-place` | `/car/code-list/inspection-place` |
|
||||
| `GET /lookups/drop-amount-status` | `/car/code-list/drop-amount-status` |
|
||||
| `GET /lookups/car-components` | `/car/base-info/car-components` |
|
||||
| `GET /lookups/accident-level` | `/car/code-list/accident-level` |
|
||||
| `GET /lookups/expert-status` | `/car/code-list/expert-status` |
|
||||
| `GET /lookups/vehicle-kinds` | `/car/base-info/vehicle-kinds` |
|
||||
| `GET /lookups/person-role` | `/common/code-list/person-role` |
|
||||
| `GET /lookups/file-types` | `/common/base-info/file-types` |
|
||||
| `GET /lookups/cities` | `/common/base-info/cities` |
|
||||
| `GET /lookups/provinces` | `/common/base-info/Provinces` |
|
||||
| `GET /lookups/dmg-case-type` | `/car/code-list/dmg-case-type` |
|
||||
| `GET /lookups/dmg-history-status` | `/car/code-list/dmg-case-history-status` |
|
||||
| `GET /lookups/used-place` | `/car/code-list/used-place` |
|
||||
| `GET /lookups/dmg-business-line` | `/car/code-list/dmg-business-line` |
|
||||
| `GET /lookups/fanavaran` | catalogue metadata (names + URLs) |
|
||||
| `GET /lookups/fanavaran/{lookupName}` | any configured name (incl. `insurance-corp`) |
|
||||
|
||||
### 4.2 Live inquiry helpers
|
||||
|
||||
| Nest route | Fanavaran path / notes |
|
||||
|------------|------------------------|
|
||||
| `GET /lookups/inquiry-by-vin?vin=` | `/car/vehicles/inquiry-by-vin` |
|
||||
| `GET /lookups/my-policies?nationalCode=&insuranceLineId=` | `/common/Policies/inquiry-my-policies` |
|
||||
| `GET /lookups/third-party-policy/:policyId` | `/car/third-party-car-policies/{id}` |
|
||||
| `GET /lookups/body-policy/:policyId` | `/car/vehicle-hull-policies/{id}` |
|
||||
|
||||
### 4.3 UI accident field helpers (local / mapped)
|
||||
|
||||
| Nest route | Purpose |
|
||||
|------------|---------|
|
||||
| `GET /lookups/accident-way` | Accident way options |
|
||||
| `GET /lookups/accident-reason` | Accident reason options (+ Fanavaran map when available) |
|
||||
| `GET /lookups/accident-type` | Accident type options |
|
||||
| `GET /lookups/accident-fields` | Combined way + reason + type |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -79,12 +79,22 @@ export class LookupsController {
|
||||
}
|
||||
|
||||
@Get("driving-licence-types")
|
||||
@ApiOperation({
|
||||
summary: "Fanavaran driving licence types lookup",
|
||||
description:
|
||||
"Returns licence type codes from car/base-info/driving-licence-types (BaseURL/Api/BimeApi/v2.0/...). Used for GEN culprit licence type selection.",
|
||||
})
|
||||
@ApiOkResponse({
|
||||
description: "Returns driving licence types lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
Caption: { type: "string" },
|
||||
Id: { type: "number" },
|
||||
IsActive: { type: "number" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user