Skip to content

Feat/bookings pricing types#373

Draft
adimara wants to merge 4 commits into
mainfrom
feat/bookings-pricing-types
Draft

Feat/bookings pricing types#373
adimara wants to merge 4 commits into
mainfrom
feat/bookings-pricing-types

Conversation

@adimara

@adimara adimara commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Add NO_FEE, CUSTOM, and VARIED alongside FIXED in the bookings seeding
guide and page templates. Previously, only FIXED was documented in the
seed payloads, and formatPrice silently returned undefined for all other
rate types — showing a blank price on free, varied, and custom services.

- SERVICES_DATA.md: add seed payload examples for all 4 rateTypes,
  document the CUSTOM constraint (inPerson: true required), add Step 4c
  for VARIED service-options-and-variants follow-up, add rateType to
  return contract, add failure modes for CUSTOM/NO_FEE payment options
- index.astro + [slug].astro: fix formatPrice — NO_FEE → "Free",
  VARIED → "Varies", CUSTOM → payment.custom.description
- custom/bookings/WIRING.md: update price comment to cover all 4 types
- INSTRUCTIONS.md: add failure mode rows for NO_FEE/VARIED/CUSTOM display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adimara adimara force-pushed the feat/bookings-pricing-types branch from e2cf218 to 917b8b5 Compare June 8, 2026 08:36
For services with rateType VARIED, the booking flow now has a proper
three-step UX: pick an option (e.g. Student / Adult), pick a time slot,
then fill in contact details.

- VariantSelector.tsx (new): fetches service options & variants via
  getServiceOptionsAndVariantsByServiceId, renders each choice as a
  card button with its price. Handles CUSTOM, DURATION, and STAFF_MEMBER
  option types. Exports SelectedVariant type used by the full flow.
- ServiceBookingFlow.tsx: add rateType prop; gate VariantSelector as
  step 1 when rateType === "VARIED"; thread selectedVariant to BookingForm.
- BookingForm.tsx: accept optional selectedVariant; send participantsChoices
  (not totalParticipants) to createBooking when a variant is selected;
  show selected variant label + price in the form header.
- [slug].astro: pass rateType={service.payment?.rateType} to ServiceBookingFlow.
- components-bookings.css: add .variant-selector / .variant-option /
  .variant-option-price / .booking-variant-price rules.
- COMPONENTS.md + INSTRUCTIONS.md: document VariantSelector, the three-step
  flow, STAFF_MEMBER name-resolution caveat, and new failure modes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adimara adimara force-pushed the feat/bookings-pricing-types branch from 86ca701 to e12b8af Compare June 8, 2026 09:04
adimara and others added 2 commits June 8, 2026 12:14
…ety, docs

- SERVICES_DATA.md: replace incorrect DURATION seed example with CUSTOM
  (DURATION's read-back shape doesn't match what a generic option payload
  produces; CUSTOM round-trips cleanly). Document that optionId in variant
  choices must be the server-assigned ID, not the option name string.
- VariantSelector.tsx: show a user-facing message when status==="none"
  instead of returning null (which silently emptied the booking section).
  Switch .map → .flatMap and skip malformed choices (CUSTOM with no value,
  DURATION with no minutes, STAFF_MEMBER with no staffMemberId) so bad data
  can't produce unbookable variants.
- BookingForm.tsx: guard durationMinutes fallback to 0 so the API never
  receives { duration: { minutes: undefined } } for a DURATION choice.
- COMPONENTS.md: add `as any` cast to SDK wiring example (TS doesn't know
  the serviceVariants key); update none-state description to match new behavior.
- INSTRUCTIONS.md: note the as-any cast requirement alongside the
  serviceVariants key gotcha.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two live-test failures:
- VARIED service creation 400: add required `varied.defaultPrice` to the
  VARIED payment block. The API rejects VARIED without it; `fixed.price`
  is also wrong. Document the correct shape and add a failure mode entry.
- Step 4c silent empty response: the agent sent `{ "options": [...] }`
  at the top level; the API accepts it but stores nothing. Rewrite Step 4c
  as a two-step sequential curl (create options → capture server-assigned
  option ID → PUT with variants referencing that ID). Add prominent warning
  about the required `serviceOptionsAndVariants` wrapper and a failure mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant