Bookings Module
Quick Answer
The bookings module lives in src/core/bookings. It provides reusable booking UI exports such as booking buttons, booking screens, and complete booking screens for appointment, rental, reservation, and Airbnb-style flows.
The module is intentionally UI-focused. Availability, pricing, calendar conflicts, payment, and confirmation rules are product-specific and must be validated by your backend.
Source Map
src/core/bookings
`-- index.js
Important exports:
| Export | Purpose |
|---|---|
IMBookButtonView | Reusable button/entry point for booking actions. |
IMBookingScreen | Booking flow screen. |
IMCompleteBookingScreen | Booking confirmation/completion screen. |
Data You Need
Most booking flows need:
- item/vendor/service being booked;
- user making the booking;
- selected date/time or date range;
- capacity or guest count if applicable;
- price and fees;
- payment status if payment is required;
- booking status;
- cancellation policy.
Do not trust client-only pricing or availability. Revalidate on the backend before confirming a booking.
Backend Requirements
Before release, define:
- collection/table for bookings;
- availability source of truth;
- conflict prevention strategy;
- payment requirement and provider;
- cancellation/refund behavior;
- notification behavior for customer and vendor/provider;
- admin/provider view for booking management.
Verification Checklist
Test:
- booking entry point opens;
- date/time selection works;
- invalid date/time is rejected;
- unavailable slot is rejected;
- payment path works if required;
- confirmation creates one booking record;
- duplicate tap does not create duplicates;
- customer can see booking after creation;
- provider/admin can see booking after creation;
- cancellation path works if supported.
Troubleshooting
| Problem | Fix |
|---|---|
| Booking UI works but no booking is saved | Connect the completion action to your backend mutation. |
| Double booking occurs | Add server-side availability checks and transactional writes. |
| Price changes after booking | Calculate final price on backend before payment/confirmation. |
| User cannot see confirmed booking | Check user ID, collection name, and booking query filters. |
| Provider cannot see booking | Check provider/vendor ID mapping and Firestore rules. |