feat(manager): products and categories on v2, a product in several categories, allergens (platform-v2 step 6.3)
- Management/ProductsTab + ProductFormModal (3.1k lines) → src/pages/products/: category tree, list/grid, toolbar + filters (search folds accents and Latin letters), bulk actions, category dialogs; the editor in editor/ (details, sold at, cost, fiscal; the waiter's choices). Arithmetic in productsLogic.js / editor/formLogic.js (tests/products.test.mjs). - Several categories per product with a main one (D-23): edited in the editor, "also in" on the rows, each category's list ordered on its own (drag or up/down → PUT /reorder with category_id); bulk "move to" / "also list in". The waiter's picker now shows a product in every category. - Allergens: products.allergens (Alembic 0032, core/allergens.py: 14 EU, contains | may_contain, catalog.allergen), in the API, POS menu, menu tablet, catalogue bundles and the cloud snapshot (C-2); @xenia/access allergens.js + <Allergens> shown on the phone, the counter, the tablet. - Bell: only the newest load sets the list (an older answer could hide a live notification). - e2e: manager (two categories, order per category, allergens), terminal / menu tablet / waiter (allergens shown); media saves by test id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,7 @@ try {
|
||||
await api('PUT', '/api/platform/modules/menu_tablet', { token: boss, body: { enabled: true } }).catch(() => {})
|
||||
const products = (await api('GET', '/api/products/?sold_at=in_store', { token: boss })).filter(p => !p.is_service_item && p.lifecycle_status === 'active')
|
||||
const souvlaki = products.find(p => /Σουβλάκι/.test(p.name)) || products[0]
|
||||
await api('PUT', `/api/products/${souvlaki.id}`, { token: boss, body: { allergens: { gluten: 'contains', mustard: 'may_contain' } } })
|
||||
|
||||
const tab = await (await browser.newContext({ viewport: { width: 1180, height: 820 }, hasTouch: true })).newPage()
|
||||
tab.on('pageerror', e => errors.push(e.message))
|
||||
@@ -55,6 +56,8 @@ try {
|
||||
await hit.click()
|
||||
r.check('…and opens it big with its price', await shown(tab, 'menu-details', 5000)
|
||||
&& (await tab.getByTestId('menu-details').getByTestId('menu-price').textContent()).includes(souvlaki.base_price.toFixed(2)))
|
||||
r.check('6.3: …with its allergens', await tab.getByTestId('menu-details').locator('[data-allergen="gluten"][data-level="contains"]').count() === 1
|
||||
&& await tab.getByTestId('menu-details').locator('[data-allergen="mustard"][data-level="may_contain"]').count() === 1)
|
||||
await tab.keyboard.press('Escape')
|
||||
await tab.getByTestId('menu-search').fill('zzzz')
|
||||
r.check('nothing found: says so', await shown(tab, 'menu-no-results', 5000))
|
||||
|
||||
Reference in New Issue
Block a user