Add TejaratNo notifier review and submission validation

This commit is contained in:
SepehrYahyaee
2026-10-10 12:51:11 +03:30
parent a410655faa
commit 8f568f379c
14 changed files with 588 additions and 34 deletions
+15 -3
View File
@@ -9,6 +9,8 @@ The expert panel's existing Fanavaran review tab now includes accident and asses
| AccidentLocationAddress | Both | Base claim | Non-empty address, up to 1,000 characters |
| AccidentCityId | Both | Base claim | `cities` |
| AccidentReportTypeId | Both | Base claim | `accident-report-type` |
| NotifierTypeId | Both, **TejaratNo only** | Base claim | Supplied `notifier-type` IDs **5516 / 5517**; 5518 is excluded |
| NotifierRelationId | Both, **TejaratNo only** | Base claim | Supplied `notifier-relation` IDs **5519–5526** |
| DmgHistoryStatus | Third-party | Damage case | `dmg-history-status` (`dmg-case-history-status` upstream) |
| InspectionPlaceId | Third-party | Expertise | `inspection-place` |
| AccidentTypeId | Car-body | Base claim | `vehicle-hull-accident-types` |
@@ -18,7 +20,17 @@ The expert panel's existing Fanavaran review tab now includes accident and asses
| RepairDuration | Car-body | Expertise | Positive integer days |
| VehicleCurrentValue | Car-body | Expertise | Positive integer **rials**, forwarded unchanged |
All seven lookup definitions already existed. Options use the deployment's active Fanavaran client and its existing live/cache lookup service. Only active canonical `Id` values are accepted; captions are resolved server-side. Array and nested `data` lookup envelopes are supported. Missing/empty lookups are shown as unavailable and cannot be replaced with guessed IDs.
The seven original remote lookup definitions already existed. Options use the deployment's active Fanavaran client and its existing live/cache lookup service. Only active canonical `Id` values are accepted; captions are resolved server-side. Array and nested `data` lookup envelopes are supported. Missing/empty lookups are shown as unavailable and cannot be replaced with guessed IDs.
### TejaratNo notifier review
For the configured deployment tenant `tejaratno` (`FANAVARAN_CLIENT`, case-insensitive), the same tab shows **نوع اعلام‌کننده** and **نسبت اعلام‌کننده**. The API supplies and validates the tenant-provided IDs/captions directly; these two lists do not depend on a remote fetch or a guessed Fanavaran lookup URL. They are also available through the existing `GET /lookups/fanavaran/notifier-type` and `GET /lookups/fanavaran/notifier-relation` routes for this tenant. Other tenants cannot edit or request these tenant-specific fields.
Neither selection has a guessed default. Both must be saved before initial vehicle approval/initial Fanavaran submission. Initial combined approval saves the IDs, captions and history atomically. Missing or excluded values cannot bypass the rule through old clients or manual submission: manual initial submission returns `409` with `FANAVARAN_NOTIFIER_REVIEW_REQUIRED`; automatic submission skips until the fields are reviewed. Already approved, unsent claims can save them with the existing versioned field PATCH endpoint. Saving fields alone does not send a remote request.
The selections are sent as `NotifierTypeId` / `NotifierRelationId` on GEN.03 for both third-party and car-body claims. Hull filtering preserves them only for TejaratNo. They lock once the base stage is sent. Existing submitted claims remain usable without a migration; submitted notifier values are preserved on subsequent hull synchronization, and unknown legacy values are not overwritten with null.
The notifier payload property names follow the proposed contract; the tenant did not provide an upstream schema. Live Fanavaran acceptance must be verified in tenant QA. No remote writes are performed by regression tests.
`VehicleCurrentValue` can remain unset when no expert override exists, preserving the existing case-value/policy-value fallback. A stored override cannot be cleared with null or an empty string. This review does not change the application's other valuation fields or calculate price drop.
@@ -34,8 +46,8 @@ All seven lookup definitions already existed. Options use the deployment's activ
- `GET /v2/expert-claim/request/:id/fanavaran-stage-fields`: applicable field definitions, current/default/submitted values, captions, compact lookup rows and per-field editability. This read does not submit a claim or persist a preview.
- `PATCH /v2/expert-claim/request/:id/fanavaran-stage-fields`: `{ values: { ...changedFields }, expectedVersion: 0, confirmed: true }`. Values must apply to the product and belong to an unsent stage. Stale versions or stages sent during validation return `409`.
- Existing `PUT .../fanavaran-vehicle-review` additionally accepts optional `stageFields` and `stageFieldsVersion` for the initial combined approval. Older clients retain their existing behavior.
- Existing `PUT .../fanavaran-vehicle-review` additionally accepts optional `stageFields` and `stageFieldsVersion` for the initial combined approval. Older clients retain their existing behavior for other tenants; TejaratNo requires the two notifier selections before initial approval.
Validated overrides and captions are stored in optional `claimCases.fanavaranFieldReview`, with version, reviewer and review timestamp. History events record before/after values and verified captions. Existing claims keep their existing defaults/fallbacks until reviewed; no migration or bulk data rewrite is required.
The review covers the eleven requested fields and the existing vehicle classification. It does not expose derived totals, provider identifiers, staff-role identifiers or every remaining field in the stage documents for arbitrary editing.
The review covers the eleven original requested fields, the two TejaratNo-only notifier fields and the existing vehicle classification. It does not expose derived totals, provider identifiers, staff-role identifiers or every remaining field in the stage documents for arbitrary editing.
+3
View File
@@ -2,6 +2,9 @@
Snapshot of **what hull submit actually sends** after `toFanavaranHullBaseClaimPayload` / `toFanavaranHullExpertisePayload`.
TejaratNo additionally sends expert-reviewed `NotifierTypeId` and `NotifierRelationId` on the base claim, using the tenant-supplied codebooks. Both are required before initial submission; see [expert field review](../fanavaran-stage-field-review.md#tejaratno-notifier-review). Other tenants' bodies are unchanged.
Experts can now review address, city, report type, accident/culprit/authority IDs, fault percentage, repair duration and vehicle value before their sending stage. See [expert field review](../fanavaran-stage-field-review.md); defaults below remain fallbacks for unreviewed records.
Staged flow (VHUD):
@@ -2,6 +2,9 @@
Snapshot of **what `ClaimRequestManagementService` actually sends** for `THIRD_PARTY` as of this version.
TejaratNo additionally sends expert-reviewed `NotifierTypeId` and `NotifierRelationId` on the base claim, using the tenant-supplied codebooks. Both are required before initial submission; see [expert field review](../fanavaran-stage-field-review.md#tejaratno-notifier-review). Other tenants' bodies are unchanged.
Experts can now override address, city, report type, damage history and inspection place before their sending stage. See [expert field review](../fanavaran-stage-field-review.md); defaults below remain fallbacks for unreviewed records.
- Base: `POST /car/third-party-car-financial-claims` (GEN.03)