Lock doctors to a single branch — never a branch picker.
Deploy Ladill Care / deploy (push) Successful in 1m3s

Doctors were treated as multi-branch when Identity cleared branch_id; now they stay on their assigned/desk site, specialty desks are home-branch only, and the queue shows site name as text only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 08:45:57 +00:00
co-authored by Cursor
parent bb4dbee81a
commit d643687335
10 changed files with 120 additions and 23 deletions
@@ -139,9 +139,12 @@ class SpecialtyModuleService
? array_map('intval', $provisionedIds)
: [];
$branchId = app(OrganizationResolver::class)->branchScope($member);
$practitioners = Practitioner::owned((string) $organization->owner_ref)
->where('organization_id', $organization->id)
->where('is_active', true)
->when($branchId, fn ($q) => $q->where('branch_id', $branchId))
->where(function ($query) use ($member) {
$query->where('member_id', $member->id)
->orWhere('user_ref', $member->user_ref);