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:
2026-11-18 10:04:35 +02:00
co-authored by Claude Opus 5.5
parent 8a02173450
commit 5048f82a4c
53 changed files with 2812 additions and 3179 deletions
+4 -1
View File
@@ -332,7 +332,7 @@ try {
preference_sets: [{ name: 'Cooking', choices: [{ name: 'Rare' }, { name: 'Well done', extra_cost: 0.5 }] }],
options: [{ name: 'Sauce', extra_cost: 0.5, sub_choices: [{ name: 'BBQ', extra_cost: 0.2, is_default: true }, { name: 'Mayo' }] }],
quick_options: [{ name: 'Cheese', price: 1, allow_multiple: true }],
ingredients: [{ name: 'Onion' }],
ingredients: [{ name: 'Onion' }], allergens: { gluten: 'contains', sesame: 'may_contain' },
} })
const posMenu = await api('GET', '/api/pos/menu', { token: boss })
const simple = posMenu.products.find(p => !p.prefs.length && p.id !== burgerP.id && p.categories.every(c => c.category_id !== cats[0].id))
@@ -359,6 +359,9 @@ try {
await burgerCard.getByTestId('product-info').click()
r.check('3.3a: price check shows the price without adding it', await shown(page, 'product-dialog', 5000)
&& (await page.getByTestId('dialog-price').textContent()).includes('10.00') && await page.getByTestId('cart-line').count() === 0)
r.check('6.3: …and its allergens (contains gluten, may contain sesame)',
await page.getByTestId('product-dialog').locator('[data-allergen="gluten"][data-level="contains"]').count() === 1
&& await page.getByTestId('product-dialog').locator('[data-allergen="sesame"][data-level="may_contain"]').count() === 1)
await page.keyboard.press('Escape')
await burgerCard.locator('button').first().click()
await page.getByTestId('product-dialog').waitFor({ timeout: 5000 })