fanavaran locations getting from branches

This commit is contained in:
2026-11-11 15:29:37 +03:30
parent d469cce463
commit 54459877a2
7 changed files with 163 additions and 22 deletions
+5 -2
View File
@@ -23,14 +23,17 @@ Secrets are **not** printed here — read from Mongo `fanavaranClientConfigs` or
| `password` | *(config)* | Login | Password | ✅ |
| `corpId` | `543` | All business calls | Corp scope | ✅ |
| `contractId` | `28` | All business calls | Contract | ✅ |
| `location` | `210050` | General calls without claim context | Tenant default OpBUId | ✅ (claim submissions require staff `locations[].id`) |
| `location` | `210050` | General calls without claim context | Tenant default OpBUId | ✅ (claim submissions require a staff location or branch code) |
Seed: `SEED_FANAVARAN_CLIENT_PROFILES` · Runtime: `getFanavaranClientProfile(key)`.
Claim submissions resolve `Location` from staff profiles in the `file-maker`,
`file-reviewer`, `expert`, `damage-expert`, and `field-expert` collections. Each
profile stores `locations: [{ id, name }]`; the first non-empty `id` is its primary
Fanavaran OpBUId. `branchId` is a local branch reference, not the HTTP Location.
Fanavaran OpBUId. When staff locations are missing, null, or empty, resolve that
staff member's `branchId` in the `branches` collection and use the branch's `code`
as the OpBUId. This branch fallback is checked before moving to another staff
candidate. The branch document's `_id` is never sent as the HTTP Location.
Resolution priority: claim initiator → blame initiator → active damage reply actor
→ assigned damage reviewer → assigned FileReviewer → assigned blame expert → blame
+1 -1
View File
@@ -53,7 +53,7 @@ Common optional properties are `branchId`, `phone`, `mobile`, `email`, `city`, `
All four codes are optional, editable and clearable for blame, claim and field experts. FileMaker accounts accept only the first two, FileReviewer accounts accept only the last two, and call-center accounts reject all four through the API. The panel presents these four named fields rather than the legacy generic `expertCode` input; existing `expertCode` values are preserved.
`locations` is an editable array of `{id, name}`. Both properties must be nonempty, and IDs must be unique within the array. These are Fanavaran OpBUId / HTTP `Location` values, rather than branch codes. On every Fanavaran business call for a claim, the integration prefers the assigned staff member's primary `locations[].id` (file-maker, file-reviewer, field, blame, or damage expert) for all tenants; the tenant auth `location` is only a fallback. Shared locations still participate in Parsian FileMaker/FileReviewer matching; management does not alter that matching logic.
`locations` is an editable array of `{id, name}`. Both properties must be nonempty, and IDs must be unique within the array. These are Fanavaran OpBUId / HTTP `Location` values. Claim submissions prefer the responsible staff member's primary `locations[].id` (file-maker, file-reviewer, field, blame, or damage expert) for all tenants. When that array is missing, null, or empty, the integration loads the staff member's branch using `branchId` and uses `branches.code`. It checks this branch fallback before moving to another staff candidate. If no candidate supplies a staff location or branch code, submission reports `FANAVARAN_STAFF_LOCATION_MISSING` instead of sending the tenant default. Shared staff locations still participate in Parsian FileMaker/FileReviewer matching; management does not alter that matching logic.
Branches require `code`, `name`, `city`, `state`, and `address`. `fullName`, `phoneNumber`, `isActive` (default true) and `activityStartDate` are optional and editable. Branch codes remain unique within an insurer. Insurer login accounts support name, email, password and optional contact/address fields; their role and tenant are assigned by the server.