Menu schema v3: variants as separate products, POS-ready fields
- variants split into their own menu_items whenever price differs (name + variant fields; 164 products, 24 variant groups) - price back to number (whole rupees); no more '449/549' strings - diet select (veg/nonveg/mixed) instead of nullable bool — PocketBase serializes empty bools as false, which misfiled mixed dishes - new fields for POS: sku (unique GB-CAT-NNN), available (86 toggle), tax_category (default food-5-gst) - migration 1788500100_menu_items_v3 replaces menu_items; resync via scripts/update-menu.mjs - cards render 'Dish – Variant', badges from diet, hide unavailable
This commit is contained in:
@@ -165,10 +165,27 @@ node scripts/update-menu.mjs
|
||||
```
|
||||
|
||||
The script **replaces** all `menu_categories` / `menu_items` records (deletes old, inserts
|
||||
new) and touches nothing else. Item prices are text, so ranges like `449/549` work;
|
||||
`group` (`veg` / `nonveg`) drives the dietary badge; `image` is an optional URL. Admin edits
|
||||
to menu records are overwritten by the next sync — treat this file as the menu's source of
|
||||
truth.
|
||||
new) and touches nothing else.
|
||||
|
||||
### `menu_items` schema (POS-oriented)
|
||||
|
||||
- `uid` — stable slug identity
|
||||
- `category` — slug → `menu_categories`
|
||||
- `name` / `variant` — variants are **separate products** whenever their price differs
|
||||
("Penne Arrabiata" + variant "Veg" ₹589 / "Chicken" ₹639); the POS can group by `name`
|
||||
- `description`
|
||||
- `price` — number, whole rupees (449 = ₹449)
|
||||
- `diet` — select: `veg` / `nonveg` / `mixed` (a bool can't be null in PocketBase, so mixed
|
||||
items like Caesar Salad use `mixed`; the site renders no badge for it)
|
||||
- `pairing` — optional beer pairing
|
||||
- `tag` — badge chip; also carries same-price choice lists (e.g. "Malai / Angara")
|
||||
- `image` — optional URL
|
||||
- `sku` — unique POS code, `GB-<CAT>-<NNN>` (e.g. GB-MNC-014)
|
||||
- `available` — false hides the item from the site (86'd) without deleting it
|
||||
- `tax_category` — default `food-5-gst`; adjust per item for POS GST mapping
|
||||
|
||||
Admin edits to menu records are overwritten by the next sync — treat `menu-data.mjs` as the
|
||||
menu's source of truth.
|
||||
|
||||
## Container environment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user