feat: call a waiter from a menu tablet at a table (platform-v2 step 5.7b)
- backend: menu tablet device config `table` (ref, validated against active
tables) and `call_waiter`; GET /api/menu-tablet/menu gives the table and
whether it can call; POST /api/menu-tablet/call sends a `table_call` staff
message ("Table 5: the guests call a waiter.", venue language) to the table's
waiters (its open order's, else the zone's), at most once a minute per tablet
(menu_tablet.call_too_soon with the seconds left; menu_tablet.no_table).
- terminal: "Call a waiter" only on a tablet at a table; "A waiter is on the
way to table 5", then a countdown before it can call again; a failed call
says to ask at the counter.
- waiter: the call shows with its own look and "Open the table".
- manager: tables as the choices of a device setting.
- tests: backend +2 (535 → 533 passed total), e2e menu_tablet.mjs +3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,11 @@ const TYPE_THEME = {
|
||||
bg: 'var(--x-info-fg)', border: 'var(--x-info)', ackBg: 'var(--x-info)',
|
||||
labelColor: 'var(--x-info-ink)', icon: '📱',
|
||||
},
|
||||
// the guests at a table called a waiter from the menu tablet on it (plan step 5.7b)
|
||||
table_call: {
|
||||
bg: 'var(--x-warning-fg)', border: 'var(--x-warning)', ackBg: 'var(--x-warning)',
|
||||
labelColor: 'var(--x-warning-ink)', icon: '🙋',
|
||||
},
|
||||
}
|
||||
|
||||
function getTheme(messageType) {
|
||||
@@ -132,7 +137,7 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{message.message_type === 'qr_order' && tableIds.length > 0 && (
|
||||
{(message.message_type === 'qr_order' || message.message_type === 'table_call') && tableIds.length > 0 && (
|
||||
<button
|
||||
data-testid="notify-open-table"
|
||||
onClick={() => { onAck(message.id); navigate(`/tables/${tableIds[0]}`) }}
|
||||
|
||||
Reference in New Issue
Block a user