forked from Yara724/api
Merge pull request 'documents of fanavaran with update' (#364) from s.hajizadeh/yara724api:main into main
Reviewed-on: Yara724/api#364
This commit is contained in:
@@ -11,7 +11,7 @@ source: fanavaran-module-docs
|
|||||||
1. `FANAVARAN_CLIENT=parsian` (or target tenant)
|
1. `FANAVARAN_CLIENT=parsian` (or target tenant)
|
||||||
2. Valid tenant credentials in Mongo / seed
|
2. Valid tenant credentials in Mongo / seed
|
||||||
3. `INSURANCE_CORP_ID` matching that tenant’s insurance-corp Caption
|
3. `INSURANCE_CORP_ID` matching that tenant’s insurance-corp Caption
|
||||||
4. Network access to `apimanager.iraneit.com`
|
4. Network access to the tenant host (`api.inssw.ir` for Moallem; `apimanager.iraneit.com` for Parsian / Tejaratno)
|
||||||
5. Optional: warm lookups via first `GET /lookups/fanavaran/{name}` or auth script
|
5. Optional: warm lookups via first `GET /lookups/fanavaran/{name}` or auth script
|
||||||
|
|
||||||
## Auth smoke test
|
## Auth smoke test
|
||||||
@@ -52,6 +52,16 @@ Fill **section A** before the first run:
|
|||||||
|
|
||||||
Lookup ids from Tejaratno/Parsian files are invalid for Moallem (Fanavaran returns `نوع خودرو یافت نشد` and similar). Fetch Moallem lookups first (`GET /lookups/vehicle-kinds` with `FANAVARAN_CLIENT=moallem`, or curl Fanavaran with that tenant’s token).
|
Lookup ids from Tejaratno/Parsian files are invalid for Moallem (Fanavaran returns `نوع خودرو یافت نشد` and similar). Fetch Moallem lookups first (`GET /lookups/vehicle-kinds` with `FANAVARAN_CLIENT=moallem`, or curl Fanavaran with that tenant’s token).
|
||||||
|
|
||||||
|
For Moallem V14, keep `FANAVARAN_API_VERSION=v14`. The script retains the V14 `AnnouncementDate` field and embeds a `DmgNotifications` item in the GEN.03 request. Fill `CLAIM_NOTIFICATION_DATE`, `NOTIFIER_TYPE_ID`, `NOTIFIER_RELATION_ID`, and `NOTIFIER_PARTY_ID` with Moallem values; the type and relation IDs must come from Moallem's own lookups. This is a live contract probe for Moallem's V14 endpoint. It does not call the V15-only GEN.30 endpoint.
|
||||||
|
|
||||||
|
### Browser UI for Moallem V14
|
||||||
|
|
||||||
|
Use the prepared Moallem env file as the UI server's working file:
|
||||||
|
|
||||||
|
FANAVARAN_FLOW_ENV=scripts/data/fanavaran-flow.moallem.env node scripts/fanavaran-flow-ui-server.js
|
||||||
|
|
||||||
|
Open http://127.0.0.1:17824, confirm the client is moallem and API version is v14, then refresh Moallem's tenant lookups. The notifier form is available for Moallem V14; enter the reporting party's national code and birth date, inquire the party, and select Moallem's notifier type and relation. Submitting GEN.03 sends the V14 body plus the embedded notifier.
|
||||||
|
|
||||||
### 2. Network / IP whitelist
|
### 2. Network / IP whitelist
|
||||||
|
|
||||||
Fanavaran Login is IP-restricted. From a **whitelisted server**, run with no proxy. From **localhost**, Termius dynamic port forwarding does **not** apply automatically — set:
|
Fanavaran Login is IP-restricted. From a **whitelisted server**, run with no proxy. From **localhost**, Termius dynamic port forwarding does **not** apply automatically — set:
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# V14 (Parsian / Moallem) vs Fanavaran V15.00 (Tejaratno)
|
||||||
|
|
||||||
|
V15.00 is the product package. HTTP paths stay `/Api/BimeApi/v2.0/car/...`. There is no `/v15` URL. Auth headers are unchanged (`authenticationToken`, `CorpId`, `ContractId`, `Location`).
|
||||||
|
|
||||||
|
**Tejaratno third-party GEN.03 uses V15.** Parsian and Moallem stay on the V14 body in [third-party-stage-fields.md](./third-party-stage-fields.md). Tejaratno car-body (hull) is not this contract.
|
||||||
|
|
||||||
|
Field tables live in the `fanavaran-api-v15` skill. The live transformer is `src/claim-request-management/fanavaran-v15-third-party-base.ts`.
|
||||||
|
|
||||||
|
## Who sends which GEN.03
|
||||||
|
|
||||||
|
| Tenant | Product | Body |
|
||||||
|
|--------|---------|------|
|
||||||
|
| Tejaratno | ثالث | V15 allowlist, no `AnnouncementDate`, one nested `DmgNotifications[]` item |
|
||||||
|
| Tejaratno | بدنه | Existing hull whitelist. Notifier type/relation are copied onto the hull root only |
|
||||||
|
| Parsian, Moallem | ثالث and بدنه | V14, including `AnnouncementDate = AccidentDate` |
|
||||||
|
|
||||||
|
GEN.12, GEN.07, and GEN.08 are the same URLs and JSON for every tenant. Do not switch Tejaratno attachments to GEN.02.
|
||||||
|
|
||||||
|
## Tejaratno third-party create
|
||||||
|
|
||||||
|
Same staged path as Parsian: GEN.03 base → GEN.12 damage → GEN.07 files (`FileName` / `FileTypeId`) → GEN.08 expertise.
|
||||||
|
|
||||||
|
GEN.03 omits `AnnouncementDate` (still an output). It also omits the V14 keys that are not in the V15 input table: `ActualPremium`, `ArchiveNo`, `AuthorityCulpritId`, `ClaimCompletionDate`, `CostSeparationToDmgSections`, `CustomerFaultPercent`, `GlassBreakReasonId`, `IsOwnerChanged`, `IsSurplusArticleEighthLaw`, `StatusChangeDate`. Do not send `ComplementClaimId`.
|
||||||
|
|
||||||
|
One `DmgNotifications` item is always nested on create. Fanavaran rejects a financial claim with no approved announcer (`PrvMustHaveAnyElamKhesaratWithTaeedStateRuleBL`). Do not POST GEN.30 before the claim exists. GEN.30 (`.../{ClaimId}/dmg-notifications`) is only an extra announcement after `claimId` exists.
|
||||||
|
|
||||||
|
| Notification field | Value on Tejaratno ثالث |
|
||||||
|
|--|--|
|
||||||
|
| `LetterNo`, `Desc`, `IsInjuredPartyIdentified`, `InjuredPartyId` | `null` |
|
||||||
|
| `ClaimNotificationDate`, `LetterDate` | accident date |
|
||||||
|
| `InjuredCount`, `DeathCount` | JSON `null`, never `0` (`FotCountAndMasdumCountMustBeReadOnlyWhenPrvIsSMPrvRuleBL`; counts are only for bodily / driver-accident files) |
|
||||||
|
| `NotifierTypeId`, `NotifierRelationId` | expert review, ids from the `lookups` collection |
|
||||||
|
| `NotifierPartyId` | guilty insurer |
|
||||||
|
|
||||||
|
`NotifierPartyId` is resolved at preview/submit, not chosen on the review form. Parties inquiry prefers RoleId **161** (بیمهگذار), then **166** (سایر). If neither exists, YARA registers the person with GEN.44 `common/other-people`. Mobile is required (`MobileIsRequiredRule`). Submit throws `FANAVARAN_NOTIFIER_PARTY_REQUIRED` when that id cannot be resolved. Preview still returns the body with a null party id.
|
||||||
|
|
||||||
|
Expert review must pick both notifier ids before the first submit (`FANAVARAN_NOTIFIER_REVIEW_REQUIRED`). Options come from Mongo `lookups` documents `notifier-type` and `notifier-relation` (`response` is `{Id, Caption, IsActive}[]`). Those two names are not fetched from Fanavaran. `common/code-list/notifier-type` 404s; the published paths are `car/code-list/notifier-type` (VHUP GEN.45) and `car/code-list/notifier-relation` (VHUP GEN.44). The stored Tejaratno type list includes **5518** (مرجع و یا نهاد رسمی) as well as 5516 and 5517. If either document is missing, the review options are empty and submit stays blocked.
|
||||||
|
|
||||||
|
After a successful create, `fanavaranSync.baseClaim.lastPayload` is the V15 body, so later review reads `NotifierTypeId` / `NotifierRelationId` from `DmgNotifications[0]` as well as the claim root.
|
||||||
|
|
||||||
|
## Unchanged stages
|
||||||
|
|
||||||
|
| Stage | URL | What YARA sends |
|
||||||
|
|-------|-----|-----------------|
|
||||||
|
| GEN.12 damage case | `.../third-party-car-financial-claims/{claimId}/dmg-cases` | Same input as V14 (driver, owner, plaque, policy, licence, `Desc`, `EstimateAmount`, `PolicyCINumber`, `BuiltYear`, `AccidentVehicleUsedId`). Output may include `Status` (`car/code-list/dmg-case-status`) |
|
||||||
|
| GEN.07 files | `.../{claimId}/files` | `FileName`, `FileTypeId`. This is the staged upload |
|
||||||
|
| GEN.08 expertise | `.../{claimId}/expertise` | Same create body (`DmgCaseId`, wages, `DmgSections[]`, `DropAmountStatus`, `ComponentReplacementTaxAndToll`, `DamagedVehicleCurrentPrice`) |
|
||||||
|
| GEN.09 / GEN.13 | damaged points / price drop | GET-only. YARA does not call them |
|
||||||
|
|
||||||
|
GEN.02 is the import-claim file service (`third-party-car-import-claims/{PrvId}/files`, `Title` + `FileType`). It is not the attachment API.
|
||||||
|
|
||||||
|
`DriverId` / `OwnerId` still come from parties inquiry (161 then 166) and GEN.44 when the person is missing. V15 documents those ids against `common/other-people`; the inquiry rule stays.
|
||||||
|
|
||||||
|
On expertise read, `HasDropAmount` is an ans lookup, and the output may include `DropAmounts[]`. GEN.13 returns `AccidentLevel`, `DropAmountRates`, and `AccidentRate`. None of that changes the create body.
|
||||||
Reference in New Issue
Block a user