Shop: item priority, block sort order and a Sort by menu #29

Merged
reudy merged 2 commits from session/add-service-priority into main 2026-11-10 12:00:39 +01:00

2 commits

Author SHA1 Message Date
80cbe6ddb2 Services: editing a saved service no longer fails validation
PocketBase reads an empty number back as 0, so mapItemRecord gave every
service capacity 0 and bufferMinutes 0. The edit form then showed
'Places in a group session: 0', below the field's min of 1, and the
browser refused to submit. 0 now maps to null (not set) for both;
every reader already treats them alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gWt7pNdAsocjxujY3m
2026-11-04 22:47:01 +00:00
e896fd3c99 Shop: item priority, block sort order and an optional "Sort by" menu
- items.priority (migration + pb_schema.json): Recommended order in Shop
  blocks, higher first, then by name. Set under Services & products, which
  now lists items in that order.
- Shop block: choose its order (Recommended, Most popular, price up/down,
  name) and optionally let visitors re-sort with a "Sort by" menu.
  sortItems() in shared/items.ts is the one place items are ordered.
- Most popular: GET /api/shop/popular returns item ids by units sold in
  paid orders over the last 90 days (ids only, no sales figures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gWt7pNdAsocjxujY3m
2026-11-04 22:36:50 +00:00