Add retail/restaurant mode toggle to the register
Deploy Ladill POS / deploy (push) Successful in 45s

A segmented Retail | Restaurant control in the register header flips the
location's service_style in place (RegisterController@setMode → pos.mode.set).
Switching to restaurant lands on the Floor and reveals Floor/Kitchen/Menu in the
sidebar; switching to retail stays on the register. Covered by PosRestaurantTest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
isaacclad
2026-06-25 12:03:46 +00:00
co-authored by Claude Opus 4.8
parent 1bbc9490f1
commit 0d816daed3
4 changed files with 47 additions and 0 deletions
+15
View File
@@ -253,6 +253,21 @@ class PosRestaurantTest extends TestCase
$this->actingAs($user)->getJson(route('pos.kitchen.feed'))->assertOk()->assertJsonCount(1, 'tickets');
}
public function test_register_mode_toggle_switches_service_style(): void
{
$user = $this->user();
// Switch to restaurant from the register — lands on the floor.
$this->actingAs($user)->post(route('pos.mode.set'), ['style' => 'restaurant'])
->assertRedirect(route('pos.floor'));
$this->assertSame('restaurant', PosLocation::owned($user->public_id)->first()->service_style);
// Back to retail — stays on the register.
$this->actingAs($user)->post(route('pos.mode.set'), ['style' => 'retail'])
->assertRedirect(route('pos.register'));
$this->assertSame('retail', PosLocation::owned($user->public_id)->first()->service_style);
}
public function test_cannot_open_two_tabs_on_one_table(): void
{
$user = $this->user();