Fix dentistry demo seed scoping departments by branch.
Deploy Ladill Care / deploy (push) Successful in 52s
Deploy Ladill Care / deploy (push) Successful in 52s
care_departments has no organization_id; match the Blood Bank seeder pattern so demo:seed no longer fails on dental specialty data. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1089,8 +1089,17 @@ class DemoTenantSeeder
|
||||
|
||||
private function seedDentistryClinicalDemo(Organization $organization, string $ownerRef): void
|
||||
{
|
||||
$departmentIds = Department::owned($ownerRef)
|
||||
// Specialty departments are provisioned without organization_id; scope via branches.
|
||||
$branchIds = Branch::owned($ownerRef)
|
||||
->where('organization_id', $organization->id)
|
||||
->pluck('id');
|
||||
|
||||
if ($branchIds->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$departmentIds = Department::owned($ownerRef)
|
||||
->whereIn('branch_id', $branchIds)
|
||||
->where('type', 'dental')
|
||||
->where('is_active', true)
|
||||
->pluck('id');
|
||||
|
||||
Reference in New Issue
Block a user