Booking Questions on Line Items
cart_service.getCartItemQuestions / answer / remove
Overview
When a seller has configured booking questions for a service, those questions attach to the cart line item. Answers (single-select, multi-select, free text, number, image upload) are written back to the line item before checkout proceeds.
User Flow
- getCartItemQuestions(cartId, lineItemId) returns the question list.
- UI renders a typed input per question (depending on question.type).
- answerCartItemQuestion posts a body shaped by type (selected_option_ids / comment / number / image_file_id).
- removeCartItemAnswer clears a previous answer if the user changes their mind.
Cases & Edge Cases
- 404 from getCartItemQuestions is treated as 'no questions for this item' — booking proceeds without blocking.
- image_upload answers require a previously-uploaded file id; the upload itself is handled by the file/upload service, not this endpoint.
- Questions are stored per-line-item, so duplicating the same service into the cart twice creates two independent question sets.
Code References
- lib/src/core/services/cart_service.dart:727 // getCartItemQuestions
- lib/src/core/services/cart_service.dart:776 // answerCartItemQuestion
- lib/src/core/services/cart_service.dart:811 // removeCartItemAnswer
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Cross-references the seller's booking_questions feature — the seller side defines them, the cart side records answers.