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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user