Fix empty demo lab catalog for admins.
Deploy Ladill Care / deploy (push) Successful in 2m7s

Seed investigation types early (before clinical data), expand the default catalog, scope Lab → Catalog by organization, and harden practitioner-branch sync so a mid-reseed failure cannot wipe the catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 09:06:35 +00:00
co-authored by Cursor
parent 899b08179e
commit f87f216fb4
5 changed files with 73 additions and 13 deletions
@@ -164,7 +164,7 @@ class ConsultationController extends Controller
->orderBy('name')
->get();
$investigationTypes = InvestigationType::owned($this->ownerRef($request))
$investigationTypes = InvestigationType::query()
->where('organization_id', $organization->id)
->where('is_active', true)
->orderBy('name')
@@ -23,7 +23,7 @@ class InvestigationTypeController extends Controller
$this->authorizeAbility($request, 'lab.manage');
$organization = $this->organization($request);
$types = InvestigationType::owned($this->ownerRef($request))
$types = InvestigationType::query()
->where('organization_id', $organization->id)
->orderBy('category')
->orderBy('name')
@@ -83,7 +83,6 @@ class InvestigationTypeController extends Controller
protected function authorizeType(Request $request, InvestigationType $type): void
{
$this->authorizeOwner($request, $type);
abort_unless($type->organization_id === $this->organization($request)->id, 404);
}