Wire Queue demo seeder to shared DemoWorld
Deploy Ladill Queue / deploy (push) Successful in 1m3s

Org name, branches, ticket customers, and staff Members now come from
DemoWorld so Queue continuity matches Care/Frontdesk across the suite.
Also resolve organization by owner_ref when metadata.queue.organization_id
is missing, and skip reseed-on-login for DemoWorld staff emails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 13:35:17 +00:00
co-authored by Cursor
parent ef7ceb076f
commit 8ff100a55b
5 changed files with 705 additions and 31 deletions
+35
View File
@@ -3,11 +3,13 @@
namespace Tests\Feature;
use App\Models\Branch;
use App\Models\Member;
use App\Models\Organization;
use App\Models\ServiceQueue;
use App\Models\Ticket;
use App\Models\User;
use App\Services\Qms\PlanService;
use App\Support\DemoWorld;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Artisan;
use Tests\TestCase;
@@ -90,4 +92,37 @@ class DemoSeedCommandTest extends TestCase
$this->assertSame($tickets, Ticket::query()->where('organization_id', $org->id)->whereNull('deleted_at')->count());
$this->assertSame('enterprise', app(PlanService::class)->planKey($org->fresh()));
}
public function test_demo_world_continuity_and_staff_roles(): void
{
$user = User::create([
'public_id' => 'demo-world-queue-id',
'name' => 'Ladill Demo (Pro)',
'email' => 'demo-pro@ladill.com',
'password' => bcrypt('password'),
]);
$exit = Artisan::call('demo:seed', ['identity' => $user->email, '--plan' => 'pro']);
$this->assertSame(0, $exit);
$org = Organization::owned($user->public_id)->firstOrFail();
$this->assertSame(DemoWorld::business('pro')['name'], $org->name);
$ama = DemoWorld::personByKey('ama-mensah');
$this->assertNotNull($ama);
$this->assertTrue(
Ticket::query()
->where('owner_ref', $user->public_id)
->where('customer_phone', $ama['phone'])
->exists()
);
$this->assertTrue(
Member::query()
->where('owner_ref', $user->public_id)
->where('user_ref', 'demo-pro-receptionist@ladill.com')
->where('role', 'receptionist')
->exists()
);
}
}