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