Feat/bookings pricing types#373
Draft
adimara wants to merge 4 commits into
Draft
Conversation
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>
e2cf218 to
917b8b5
Compare
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>
86ca701 to
e12b8af
Compare
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.