Strip healthcare packaging and Care integration from Queue.
Deploy Ladill Queue / deploy (push) Successful in 3m12s
Deploy Ladill Queue / deploy (push) Successful in 3m12s
Queue is general-purpose QMS only; Care runs its own native engine. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,12 +23,13 @@ class IndustryPackageTest extends TestCase
|
||||
{
|
||||
$registry = app(IndustryPackageRegistry::class);
|
||||
|
||||
$this->assertTrue($registry->has('healthcare'));
|
||||
$this->assertTrue($registry->has('banking'));
|
||||
$this->assertTrue($registry->has('vehicle'));
|
||||
$this->assertTrue($registry->has('restaurant'));
|
||||
$this->assertTrue($registry->has('custom'));
|
||||
$this->assertSame('Healthcare', $registry->get('healthcare')->label());
|
||||
$this->assertSame('patient', $registry->get('healthcare')->ticketEntity());
|
||||
$this->assertSame('Banking', $registry->get('banking')->label());
|
||||
$this->assertSame('customer', $registry->get('banking')->ticketEntity());
|
||||
$this->assertSame('vehicle', $registry->get('vehicle')->ticketEntity());
|
||||
$this->assertSame('order', $registry->get('restaurant')->ticketEntity());
|
||||
}
|
||||
|
||||
@@ -76,18 +77,18 @@ class IndustryPackageTest extends TestCase
|
||||
$this->assertGreaterThanOrEqual(3, $workflow->steps()->count());
|
||||
}
|
||||
|
||||
public function test_healthcare_uses_assigned_only_for_consultation(): void
|
||||
public function test_vehicle_uses_assigned_only_for_mechanic(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'pkg-care-owner',
|
||||
'name' => 'Clinic Owner',
|
||||
'email' => 'clinic-owner@example.com',
|
||||
'public_id' => 'pkg-vehicle-owner',
|
||||
'name' => 'Garage Owner',
|
||||
'email' => 'garage-owner@example.com',
|
||||
'password' => bcrypt('password'),
|
||||
]);
|
||||
|
||||
// Pro plan so all healthcare stages fit under queue caps.
|
||||
// Pro plan so all vehicle stages fit under queue caps.
|
||||
$org = app(OrganizationResolver::class)->completeOnboarding($user, [
|
||||
'organization_name' => 'Ridge Clinic',
|
||||
'organization_name' => 'Ridge Motors',
|
||||
'industry' => 'custom',
|
||||
'appointment_mode' => 'hybrid',
|
||||
'branch_name' => 'Main',
|
||||
@@ -101,19 +102,19 @@ class IndustryPackageTest extends TestCase
|
||||
]);
|
||||
|
||||
$branch = Branch::where('organization_id', $org->id)->first();
|
||||
$result = app(IndustryPackageInstaller::class)->install($org->fresh(), $branch, 'healthcare');
|
||||
$result = app(IndustryPackageInstaller::class)->install($org->fresh(), $branch, 'vehicle');
|
||||
|
||||
$this->assertSame('healthcare', $result['package']);
|
||||
$this->assertSame('vehicle', $result['package']);
|
||||
$this->assertGreaterThanOrEqual(5, $result['stages']);
|
||||
|
||||
$consultation = ServiceQueue::query()
|
||||
$mechanic = ServiceQueue::query()
|
||||
->where('organization_id', $org->id)
|
||||
->where('settings->stage_code', 'consultation')
|
||||
->where('settings->stage_code', 'mechanic')
|
||||
->first();
|
||||
|
||||
$this->assertNotNull($consultation);
|
||||
$this->assertSame('assigned_only', $consultation->routingMode());
|
||||
$this->assertSame('C', $consultation->prefix);
|
||||
$this->assertNotNull($mechanic);
|
||||
$this->assertSame('assigned_only', $mechanic->routingMode());
|
||||
$this->assertSame('M', $mechanic->prefix);
|
||||
}
|
||||
|
||||
public function test_package_install_is_idempotent(): void
|
||||
@@ -182,38 +183,6 @@ class IndustryPackageTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_care_integration_skips_stage_materialization(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'pkg-care-skip',
|
||||
'name' => 'Care Skip',
|
||||
'email' => 'care-skip@example.com',
|
||||
'password' => bcrypt('password'),
|
||||
]);
|
||||
|
||||
$org = app(OrganizationResolver::class)->completeOnboarding($user, [
|
||||
'organization_name' => 'Care Linked',
|
||||
'industry' => 'custom',
|
||||
'appointment_mode' => 'hybrid',
|
||||
'branch_name' => 'Main',
|
||||
'timezone' => 'UTC',
|
||||
]);
|
||||
$org->update([
|
||||
'settings' => array_merge($org->settings ?? [], [
|
||||
'integrations' => ['care_enabled' => true],
|
||||
]),
|
||||
]);
|
||||
$before = ServiceQueue::where('organization_id', $org->id)->count();
|
||||
$branch = Branch::where('organization_id', $org->id)->first();
|
||||
|
||||
$result = app(IndustryPackageInstaller::class)->install($org->fresh(), $branch, 'healthcare');
|
||||
|
||||
$this->assertSame('stages_managed_by_integration', $result['skipped_reason']);
|
||||
$this->assertSame(0, $result['stages']);
|
||||
$this->assertSame($before, ServiceQueue::where('organization_id', $org->id)->count());
|
||||
$this->assertSame('patient', data_get($org->fresh()->settings, 'industry_package.ticket_entity'));
|
||||
}
|
||||
|
||||
public function test_replace_install_clears_previous_queues_and_tickets(): void
|
||||
{
|
||||
$user = User::create([
|
||||
|
||||
Reference in New Issue
Block a user