feat: ordering from the menu tablet at a table (platform-v2 step 6.6, D-30)
- tablet_orders (0034) + services/tablet_orders.py: venue rules (menu_tablet.ordering) with
per-tablet overrides: kitchen or waiter confirms first, no open order open/refuse, limits
(items per order, of one dish, time between orders)
- /api/menu-tablet: quote, order, order/{id}, bill (see + ask), requests accept/decline, ordering
- terminal: Add to the order (POS ProductDialog), cart, note, send, live status, the bill
- waiter: TabletRequests on the table page, tablet_order message theme with Open the table
- manager: Settings -> Menu tablets
- tests: test_tablet_orders.py, menu-tablet unit, menu_tablet.mjs e2e (the done-when)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,3 +46,15 @@ test('the menu in the language of the tablet (6.4): names switch, the base name
|
||||
assert.ok(matches(en.products[1], 'souvl') && matches(en.products[1], 'pork'))
|
||||
assert.equal(localize(data, 'el').products[1].name, 'Σουβλάκι')
|
||||
})
|
||||
|
||||
test('the tablet\'s cart (6.6): add, join the same choices, more / less, count', async () => {
|
||||
const { addToCart, cartCount, cartLines, changeQty } = await import('../src/apps/menu-tablet/ordering.js')
|
||||
let cart = addToCart([], { line: { product_id: 5, quantity: 1, quick: [{ id: 9, qty: 1 }] }, name: 'Pork skewer' })
|
||||
cart = addToCart(cart, { line: { product_id: 5, quantity: 2, quick: [{ id: 9, qty: 1 }] }, name: 'Pork skewer' })
|
||||
cart = addToCart(cart, { line: { product_id: 6, quantity: 1 }, name: 'Beer' })
|
||||
assert.equal(cart.length, 2)
|
||||
assert.equal(cart[0].line.quantity, 3)
|
||||
assert.equal(cartCount(cart), 4)
|
||||
assert.deepEqual(cartLines(changeQty(cart, 1, -1)), [{ product_id: 5, quantity: 3, quick: [{ id: 9, qty: 1 }] }])
|
||||
assert.equal(changeQty(cart, 0, 1)[0].line.quantity, 4)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user