Lock doctors to a single branch — never a branch picker.
Deploy Ladill Care / deploy (push) Successful in 1m3s
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user