Shop: item priority, block sort order and a Sort by menu #29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "session/add-service-priority"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
items.priority, −1000…1000, empty = 0). Set under Services & products → Priority in the shop. Higher numbers come first; equal ones go by name. That list is now in shop order and shows each item's priority.GET /api/shop/popular. It returns item ids only, never the numbers. Refunded orders don't count. Products handed over inside a bundle don't count either (the bundle itself does). Bookings paid with a code count for their service. Items with no recent sales come after, in Recommended order. Until anything has sold, the menu leaves Most popular out.Behaviour change
Chosen items (
itemIds) used to be shown in the order they were clicked, which you couldn't see in the editor. They now follow the block's order. Existing items all start at priority 0, so existing shops stay alphabetical until priorities are set.Tested
npm run checkin both apps: 0 errors (warnings unchanged, all in files this PR doesn't touch).pb_schema.jsonwas a no-op. With test orders,/api/shop/popularranked correctly: the refunded order and the price-0 bundle part were excluded and the unsold item was left out. Sorting by-priority,namegave the expected order.Also fixed (separate commit)
Editing any saved service was blocked on
main. PocketBase returns an empty number as 0, so the form opened with "Places in a group session: 0". That's below the field's minimum of 1, so the browser refused to submit.mapItemRecordnow maps 0 tonullforcapacityandbufferMinutes.🤖 Generated with Claude Code
https://claude.ai/code/session_01HA82gWt7pNdAsocjxujY3m