Shop: duration slider on services, times fetched per service and length

Service cards step through their lengths with a slider and the price
follows. The time picker loads bookable times for the chosen length and
the months on screen from GET /api/slots (a proxy to the shop hook in each
app), and reloads when the basket's bookings change. Checkout, emails and
the basket show each booking's own length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
agent 2026-10-25 20:12:46 +00:00
parent 23df2ceced
commit eac99b2abe
18 changed files with 479 additions and 210 deletions

View file

@ -72,8 +72,12 @@ export function createBasketStore(initial: Basket | null) {
applyBasket(await callApi({ action: 'add_item', itemId, quantity }));
}
async function addSlotLine(slotId: string) {
await applySlotChange(await callApi({ action: 'add_slot', slotId }));
/**
* Book a time: in a window, `slotId` plus the service, length and start
* picked; for a group session, `slotId` alone (one place).
*/
async function addSlotLine(slotId: string, booking: { itemId: string; minutes: number; start: string } | null = null) {
await applySlotChange(await callApi({ action: 'add_slot', slotId, ...booking }));
}
async function updateQuantity(lineId: string, quantity: number) {