Files
xenia-pos-local/packages/access/src/index.js
T
bonaminandClaude Opus 5.5 5048f82a4c 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>
2026-11-18 10:04:35 +02:00

23 lines
1.5 KiB
JavaScript

// @xenia/access — what this venue has turned on and what the signed-in user may do,
// for every frontend (plan step 2.5, APPS_PLATFORM §5, §6, §9). React; imported from source.
//
// <AccessProvider client={client} token={token} i18n={i18n}> loads bootstrap, sets language,
// … mounts the manager-approval dialog
// useAccess() → { venue, user, permissions, modules, license, refresh }
// useModule('kds') · useCan('catalog.menu.manage') · useCan([a, b]) (any) · useCan([a, b], { all: true })
// useAllowed('ordering.orders.cancel') → 'yes' | 'approve' (a manager's PIN) | 'no' (4.3)
// <Can perm="…" fallback={…}> · <RequireModule module="…">
//
// SALES_POINTS, IN_PERSON, DIGITAL where an order is sold (phase 3S)
// ALLERGENS, allergenList, setAllergen the 14 EU allergens (6.3)
//
// UI hiding only: the backend checks every request (CS-14).
export { AccessProvider } from './AccessProvider.jsx'
export { useAccess, useModule, useCan, can, useAllowed, allowed } from './hooks.js'
export { Can, RequireModule, ModuleOff, NoAccess } from './guards.jsx'
export { OverrideHost } from './OverrideHost.jsx'
export { SALES_POINTS, IN_PERSON, DIGITAL, normalizeSalesPoints } from './salesPoints.js'
export { ALLERGENS, ALLERGEN_LEVELS, allergenList, nextAllergenLevel, setAllergen } from './allergens.js'
export { Allergens } from './Allergens.jsx'