Seed DemoWorld staff and customer continuity for POS demo data
Deploy Ladill POS / deploy (push) Successful in 56s
Deploy Ladill POS / deploy (push) Successful in 56s
Replace ad-hoc demo-cashier-{id} accounts with DemoWorld staff who hold
a pos role, mirrored locally by email until SSO remaps to public_id.
Sales for the first named customers now use DemoWorld people (name +
phone) instead of generic "Cash Customer N" labels, and staff logins
skip the login reseed so mid-demo state survives.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\Pos\ProSubscription;
|
||||
use App\Models\PosLocation;
|
||||
use App\Models\PosMember;
|
||||
use App\Models\PosProduct;
|
||||
use App\Models\PosSale;
|
||||
use App\Models\User;
|
||||
@@ -104,4 +105,28 @@ class DemoSeedCommandTest extends TestCase
|
||||
$this->assertSame($products, PosProduct::owned($user->public_id)->count());
|
||||
$this->assertSame($sales, PosSale::owned($user->public_id)->count());
|
||||
}
|
||||
|
||||
public function test_pro_seed_provisions_demo_world_cashier_and_named_customer(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'demo-pos-pro-staff',
|
||||
'name' => 'Demo Pro',
|
||||
'email' => 'demo-pro@ladill.com',
|
||||
'password' => bcrypt('password'),
|
||||
]);
|
||||
|
||||
Artisan::call('demo:seed', ['identity' => $user->email, '--plan' => 'pro']);
|
||||
|
||||
$this->assertDatabaseHas('users', ['email' => 'demo-pro-cashier@ladill.com']);
|
||||
$this->assertTrue(
|
||||
PosMember::owned($user->public_id)
|
||||
->where('user_ref', 'demo-pro-cashier@ladill.com')
|
||||
->where('role', PosMember::ROLE_CASHIER)
|
||||
->exists()
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
PosSale::owned($user->public_id)->where('customer_name', 'Ama Mensah')->exists()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user