Add Lab and Blood Bank manager roles with admin UIs.
Deploy Ladill Care / deploy (push) Successful in 46s
Deploy Ladill Care / deploy (push) Successful in 46s
Give lab_manager catalog/ops admin access and blood_bank_manager a branch-level stock register plus specialty admin surface, while keeping technicians on clinical queues. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -286,6 +286,50 @@ class CareLabTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_lab_manager_can_access_admin_and_catalog(): void
|
||||
{
|
||||
Member::where('user_ref', $this->user->public_id)->update([
|
||||
'role' => 'lab_manager',
|
||||
'branch_id' => $this->branch->id,
|
||||
]);
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->get(route('care.lab.admin.index', ['branch_id' => $this->branch->id]))
|
||||
->assertOk()
|
||||
->assertSee('Lab admin')
|
||||
->assertSee('Manage catalog');
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->get(route('care.lab.catalog.index'))
|
||||
->assertOk()
|
||||
->assertSee('Investigation catalog');
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->post(route('care.lab.catalog.store'), [
|
||||
'name' => 'Manager Panel',
|
||||
'code' => 'MGR',
|
||||
'category' => 'blood',
|
||||
'price_minor' => 2200,
|
||||
'is_active' => true,
|
||||
])
|
||||
->assertRedirect(route('care.lab.catalog.index'));
|
||||
|
||||
$this->assertDatabaseHas('care_investigation_types', [
|
||||
'organization_id' => $this->organization->id,
|
||||
'name' => 'Manager Panel',
|
||||
'price_minor' => 2200,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_lab_technician_cannot_access_lab_admin(): void
|
||||
{
|
||||
Member::where('user_ref', $this->user->public_id)->update(['role' => 'lab_technician']);
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->get(route('care.lab.admin.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_api_can_request_investigation(): void
|
||||
{
|
||||
Sanctum::actingAs($this->user);
|
||||
|
||||
Reference in New Issue
Block a user