Ürünler (/urunler)

Product catalog management: create/edit products, prices and sale windows, stations, category/subcategory structure, and availability (stock / disable windows). Internal tab id: products.

Who can open it

Patron only. Other roles are redirected to Masalar if they hit /urunler.

Purpose

  • Maintain the menu catalog consumed by Staff (add-item) and by the Customer app (/api/menu/products/)
  • Set base price, compare-at / sale windows, portions
  • Assign kitchen vs bar station (there is still no separate kitchen screen)
  • Reorder categories/subcategories and products
  • Disable products for today, forever, or a custom window; mark stock states

Key files

Area Paths
UI src/components/pos/ProductsManager.tsx, ProductRow.tsx
Dialogs CreateProductDialog.tsx, CustomDisableDialog.tsx, CategoryDialog.tsx, AddSubcategoryDialog.tsx
Reorder ReorderControls.tsx
Catalog merge src/lib/menu/catalog.ts, sale-window helpers
Queries / writes catalog React Query hooks + product *.functions.ts

Data & APIs

Call Role
GET /api/products/ Full catalog
POST /api/products/ Create
Product update / price / patch endpoints Edit fields, station, sort
POST /api/products/reassign-subcategory/ Move under another subcategory
/api/product-availability/… Disable / stock rows

Customer menu reads a related public menu surface; keep naming and product_key stable when changing catalog identity.

State

  • React Query products + availability
  • Local merged catalog view for search / collapsible categories
  • Optimistic list updates on common edits

UX details

  • Search across products
  • Collapsible category sections
  • Disable modes: today / forever / custom date window
  • Stock states (in stock / low / out) feed floor and customer availability

Development notes

  • Validate payloads with Zod in *.functions.ts before shipping new fields
  • Sale window math should stay in shared menu helpers so Staff and Customer pricing stay consistent
  • After structural category changes, confirm Customer grouping still makes sense (CATEGORY_ORDER / API category names)
  • Patron-only: do not expose product CRUD behind barkasa/garson nav