feat(claims): add insurer review referrals

This commit is contained in:
SepehrYahyaee
2026-11-24 15:16:14 +03:30
parent f29461fa67
commit 4e0e6f83dc
29 changed files with 1581 additions and 37 deletions
+10
View File
@@ -39,6 +39,16 @@ Schedules use Tehran time and allow one opening window per weekday. Omitted days
Case creation and updates use the liable insurer's hours once it is identified. At intake, staff use their own insurer's hours. For public intake before the case insurer is known, set the API's existing `CLIENT_ID` to the deployment insurer's numeric client code. If an intake has no known insurer and the deployment has no configured insurer, the schedule applies once the insurer is identified. Case reads, login and schedule settings are available outside those hours. Blocked case updates return HTTP 403 with `OUTSIDE_WORKING_HOURS` and the next opening.
## Refer a case for damage assessment
In the insurer case details, use **ارجاع پرونده** to choose an active expert in an active branch of the same company. The destination role follows the original workflow: damage expert for V1/V6, field expert for V2/V3, and file reviewer for V4/V5.
Referral becomes available once intake and evidence capture are complete and the claim is ready for damage assessment or factor validation. V4/V5 files still in the FileMaker or capture steps stay in those workflows. Any successful Fanavaran stage, including automatic base-claim registration, closes referral eligibility.
The referral updates the claim's review branch and clears the previous review lock. The new expert opens the case from the expert review list. The intake owner and branch remain in the linked blame case, and V5 approval stays with the original FileMaker. The case timeline records the insurer account and the previous and new experts and branches.
The insurer routes are `GET /expert-insurer/files/:publicId/review-referral` for eligible experts and the current revision, and `PATCH /expert-insurer/files/:publicId/review-referral` with `expertId` and `revision`. A concurrent write or submission can require refreshing the referral options.
## Fields
`role` is one of `expert`, `damage_expert`, `field_expert`, `file_maker`, `file_reviewer`, or `call_center`, and is selected only during creation. These use the existing collections and actor login mechanism.