new person registration + car body matching accident date with endDate

This commit is contained in:
2026-11-21 12:47:50 +03:30
parent 5c6e21dd14
commit ab3ae53ec0
8 changed files with 462 additions and 27 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ Example hull-only GEN.03 body (proven Parsian case): [`stage1-hull-body.json`](.
| Field | Source |
|-------|--------|
| `ActualPremium` | `GET /lookups/body-policy/{PolicyId}` → `TotalPremium` |
| `AccidentCulpritId` | `GET /lookups/inquiry-by-unique-identifier?nationalCode=…&birthday=…` → `driverId` (fallback: policy `CustomerId`) |
| `AccidentCulpritId` | `GET /lookups/inquiry-by-unique-identifier?nationalCode=…&birthday=…` → inspect `parties` for RoleId **166**. Hull submit registers GEN.44 when missing and re-inquires to verify; preview stays read-only. The wrapper `driverId` may fall back to role 161 and is insufficient for this check. |
| `CustomerFaultPercent` | **100** (required; درصد تقصير بيمه گذار) |
| `AuthorityCulpritId` | `GET /lookups/detection-accident-culprits` → بیمه‌گذار (required; مرجع تعيين مقصر) |
+14 -1
View File
@@ -51,7 +51,7 @@ is required. The existing missing-date fallback is `1400/01/01`.
| AccidentTypeId | نوع حادثه بدنه | number | **no** | Reviewed choice, else current `vehicle-hull-accident-types` row caption تصادف(حادثه); no numeric fallback |
| CulpritTypeId | نوع مقصر بدنه | number | **no** | Reviewed choice, else current `vehicle-hull-accident-culprit-type` row caption بیمه‌گذار; never reuse third-party `337` |
| AuthorityCulpritId | مرجع تعیین مقصر | number | **no** | Reviewed choice, else current `detection-accident-culprits` row caption بیمه‌گذار; no numeric fallback |
| AccidentCulpritId | شناسه مقصر فناوران | number | preferred | **inquiry** parties `inquiry-by-unique-identifier`, fallback hull policy `CustomerId` |
| AccidentCulpritId | شناسه مقصر فناوران | number | **no** | Actual driver from parties inquiry with RoleId **166**; submit registers GEN.44 if missing, then verifies the role. Preview warns without creating a person. |
| CustomerFaultPercent | درصد تقصیر بیمه‌گذار | number | **no** | **user** expert review, else **system** `100` |
| CostSeparationToDmgSections | تفکیک هزینه به نقاط | number (ans) | **no** | **system** `0` خیر · lookup `ans` |
| IsOwnerChanged | مالک تغییر یافته؟ | number (ans) | **no** | **system** `0` · lookup `ans` |
@@ -161,3 +161,16 @@ Not ثالث GEN.08: no `DmgCaseId`, `InspectionPlaceId`, `RepairWage` on the ro
Same routes as ثالث (`/base-claim`, `/attachments`, `/expertise`).
`/damage-case` preview/submit **skips** for `CAR_BODY`.
### Hull driver registration
A policyholder-only (`RoleId=161`) inquiry does not satisfy the hull driver role.
Before base-claim submission or hull synchronization, YARA checks the actual driver
for `RoleId=166` (سایر) and registers `common/other-people` when missing, using
national code, birthday and person details. The policyholder role is preserved.
The returned create ID is used only after a subsequent inquiry verifies role 166.
A successful registration is cached with national code and birthday so retries
wait for verification rather than creating the same role again. Missing identity,
lookup failures or unverified registration block the external hull write with
`FANAVARAN_HULL_DRIVER_ROLE_REQUIRED`; local claim creation remains best-effort.
Third-party driver/owner resolution continues to accept roles 161 or 166.