Add ambulance New call flow under ambulance.manage.
Deploy Ladill Care / deploy (push) Successful in 1m41s

Walk-in appointments require appointments.manage, which blocked EMS staff; New call now uses a dedicated specialty route that lands on the dispatch board.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 12:20:29 +00:00
co-authored by Cursor
parent 4e753e68c0
commit 527a469b78
5 changed files with 246 additions and 2 deletions
+49 -1
View File
@@ -254,6 +254,54 @@ class CareAmbulanceSuiteTest extends TestCase
->assertSee('Handover')
->assertSee($this->patient->fullName())
->assertDontSee('Call next')
->assertDontSee('Bring the next waiting patient to your desk');
->assertDontSee('Bring the next waiting patient to your desk')
->assertSee(route('care.specialty.ambulance.new-call'), false);
}
public function test_ambulance_staff_can_log_new_call_without_appointments_manage(): void
{
$user = User::create([
'public_id' => 'amb-crew',
'name' => 'Kojo Ambulance',
'email' => 'kojo-amb@example.com',
]);
Member::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'user_ref' => $user->public_id,
'role' => 'ambulance_staff',
'branch_id' => $this->branch->id,
]);
$this->actingAs($user)
->get(route('care.appointments.walk-in.create'))
->assertForbidden();
$this->actingAs($user)
->get(route('care.specialty.ambulance.new-call'))
->assertOk()
->assertSee('Log a new call');
$this->actingAs($user)
->post(route('care.specialty.ambulance.new-call.store'), [
'branch_id' => $this->branch->id,
'patient_id' => $this->patient->id,
'reason' => 'Chest pain',
'location' => 'Spintex Road',
])
->assertRedirect(route('care.specialty.show', 'ambulance'));
$this->assertDatabaseHas('care_appointments', [
'patient_id' => $this->patient->id,
'branch_id' => $this->branch->id,
'type' => Appointment::TYPE_WALK_IN,
]);
$visit = Visit::query()
->where('patient_id', $this->patient->id)
->where('specialty_stage', 'check_in')
->latest('id')
->first();
$this->assertNotNull($visit);
}
}