Hard-delete Care remote Queue adapter (Phase 5).
Deploy Ladill Care / deploy (push) Failing after 1m13s

Care Queue Engine is the only path; remove QueueClient, driver config, and remote HTTP tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 11:16:41 +00:00
co-authored by Cursor
parent 966f0496b2
commit dd4bc493b4
31 changed files with 441 additions and 2108 deletions
+58 -59
View File
@@ -3,11 +3,17 @@
namespace Tests\Feature;
use App\Http\Middleware\EnsurePlatformSession;
use App\Models\Appointment;
use App\Models\Branch;
use App\Models\CareQueueTicket;
use App\Models\Member;
use App\Models\Organization;
use App\Models\Patient;
use App\Models\Practitioner;
use App\Models\User;
use App\Services\Care\AppointmentService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
/**
@@ -21,16 +27,13 @@ class CareNaturalQueueTest extends TestCase
protected Organization $organization;
protected Branch $branch;
protected function setUp(): void
{
parent::setUp();
$this->withoutMiddleware(EnsurePlatformSession::class);
config([
'care.queue.api_url' => 'https://queue.test/api/v1',
'care.queue.api_key' => 'care-test-key',
]);
$this->owner = User::create([
'public_id' => 'care-queue-owner',
'name' => 'Owner',
@@ -47,38 +50,6 @@ class CareNaturalQueueTest extends TestCase
'plan' => 'pro',
'plan_expires_at' => now()->addMonth()->toIso8601String(),
'queue_integration_enabled' => true,
'department_queue_provisioning' => [
'consultation' => [
'queues' => [[
'branch_id' => 1,
'name' => 'Consultation',
'active' => true,
'synced' => true,
'queue_uuid' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'counter_uuid' => 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
]],
],
'pharmacy' => [
'queues' => [[
'branch_id' => 1,
'name' => 'Pharmacy',
'active' => true,
'synced' => true,
'queue_uuid' => 'cccccccc-cccc-cccc-cccc-cccccccccccc',
'counter_uuid' => 'dddddddd-dddd-dddd-dddd-dddddddddddd',
]],
],
'laboratory' => [
'queues' => [[
'branch_id' => 1,
'name' => 'Laboratory',
'active' => true,
'synced' => true,
'queue_uuid' => 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee',
'counter_uuid' => 'ffffffff-ffff-ffff-ffff-ffffffffffff',
]],
],
],
],
]);
@@ -89,19 +60,12 @@ class CareNaturalQueueTest extends TestCase
'role' => 'hospital_admin',
]);
$branch = Branch::create([
$this->branch = Branch::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'name' => 'Main',
'is_active' => true,
]);
// Keep provisioning stubs aligned with the created branch id.
$settings = $this->organization->settings;
foreach (['consultation', 'pharmacy', 'laboratory'] as $ctx) {
$settings['department_queue_provisioning'][$ctx]['queues'][0]['branch_id'] = $branch->id;
}
$this->organization->update(['settings' => $settings]);
}
public function test_sidebar_does_not_show_service_queues_nav(): void
@@ -165,24 +129,59 @@ class CareNaturalQueueTest extends TestCase
public function test_doctor_call_next_uses_consultation_queue_not_reception(): void
{
\Illuminate\Support\Facades\Http::fake([
'*/queues/*/call-next*' => \Illuminate\Support\Facades\Http::response([
'data' => [
'uuid' => '77777777-7777-7777-7777-777777777777',
'ticket_number' => 'C001',
'status' => 'called',
],
], 200),
Http::fake();
$practitioner = Practitioner::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'name' => 'Dr. Natural',
'room' => 'Room 1',
'is_active' => true,
]);
$branchId = Branch::query()->firstOrFail()->id;
$patient = Patient::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_number' => 'P-N1',
'first_name' => 'Ada',
'last_name' => 'Lovelace',
]);
$appointment = Appointment::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_id' => $patient->id,
'practitioner_id' => $practitioner->id,
'type' => Appointment::TYPE_WALK_IN,
'status' => Appointment::STATUS_SCHEDULED,
'scheduled_at' => now(),
]);
app(AppointmentService::class)->checkIn(
$appointment->fresh(['organization', 'patient', 'practitioner']),
$this->owner->public_id,
$this->owner->public_id,
);
$this->actingAs($this->owner)
->post(route('care.queue.call-next'), ['branch_id' => $branchId])
->assertRedirect();
->post(route('care.queue.call-next'), [
'branch_id' => $this->branch->id,
'practitioner_id' => $practitioner->id,
])
->assertRedirect()
->assertSessionHas('success');
\Illuminate\Support\Facades\Http::assertSent(function ($request) {
return str_contains($request->url(), '/queues/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/call-next');
});
$this->assertDatabaseHas('care_queue_tickets', [
'care_entity_id' => $appointment->id,
'status' => CareQueueTicket::STATUS_CALLED,
]);
$this->assertDatabaseMissing('care_service_queues', [
'organization_id' => $this->organization->id,
'context' => 'reception',
]);
Http::assertNothingSent();
}
}