feat(waiter): table bookings on the phone; shared ReasonPicker (platform-v2 step 4.8c)
- Waiter: Bookings (side drawer, for whoever has connect_orders.manage or reservations.manage, with the online-orders app on): requests made online are confirmed or declined with a reason the guest sees; confirmed ones are seated at a free table (its seats shown, a warning mark when the party is bigger) or cancelled / marked as a no-show; the food ordered ahead and its kitchen time; live updates. - Backend: the bookings routes take reservations.manage too (require_any). - @xenia/ui ReasonPicker + reasonText (gallery, unit test), first piece moved from the terminal (4.6 → 4.8): the counter's online reject and booking decline dialogs use it; the waiter loads @xenia/ui styles.css (the .x-* components; tokens as before). - Tests: waiter e2e +2 (request listed with the key, confirmed and seated from the phone); terminal.mjs and qr_table.mjs green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -275,6 +275,19 @@ const DRAWER_NAV_ITEMS = [
|
||||
},
|
||||
{ ...NAV_REGISTRY.orders },
|
||||
{ ...NAV_REGISTRY.messages },
|
||||
{
|
||||
// table bookings (4.8): for whoever handles online orders or manages reservations
|
||||
key: 'bookings',
|
||||
label: 'nav.bookings',
|
||||
href: '/bookings',
|
||||
match: (loc) => loc.pathname === '/bookings',
|
||||
icon: (
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none">
|
||||
<rect x="3" y="5" width="18" height="16" rx="2" stroke="currentColor" strokeWidth="2"/>
|
||||
<path d="M3 10h18M8 3v4M16 3v4M9 15l2 2 4-4" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'shift-overview',
|
||||
label: 'nav.shiftSummary',
|
||||
@@ -375,6 +388,10 @@ function SideDrawer({ open, onClose }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const navigate = useNavigate()
|
||||
const chatOn = useChatOn()
|
||||
const bookingsModule = useModule('connect_orders')
|
||||
const bookingsOnline = useCan('connect_orders.manage')
|
||||
const bookingsManage = useCan('reservations.manage')
|
||||
const bookingsOn = bookingsModule && (bookingsOnline || bookingsManage)
|
||||
const location = useLocation()
|
||||
const { activeZoneTab, setActiveZoneTab } = useTableViewStore()
|
||||
|
||||
@@ -425,7 +442,7 @@ function SideDrawer({ open, onClose }) {
|
||||
<div style={{ fontSize: 10, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 1, padding: '4px 10px 8px' }}>
|
||||
{t('shell.navigation')}
|
||||
</div>
|
||||
{DRAWER_NAV_ITEMS.filter(shown(chatOn)).map(item => {
|
||||
{DRAWER_NAV_ITEMS.filter(shown(chatOn)).filter(item => item.key !== 'bookings' || bookingsOn).map(item => {
|
||||
const isStandaloneActive = location.pathname === '/tables' && activeZoneTab === 'standalone'
|
||||
const active = item.key === 'standalone'
|
||||
? isStandaloneActive
|
||||
|
||||
Reference in New Issue
Block a user