Overview
The booking system consists of:Trip Bookings
Core booking records linking tourists, guides, and tours
Status Tracking
Complete status lifecycle management
Status History
Audit trail of all status changes
Trip Bookings
Trip bookings are the central entity representing a tourist’s reservation of a guide’s tour.Data Model
Key Features
- Multi-Entity Link: Connects tourist, guide, and tour in one booking
- Time Management: Start and end datetime for the tour
- Status Lifecycle: Tracks booking progress through various states
- Cancellation Support: Optional
cancelReasonfield - Notes: Flexible notes field for special requests or details
Each booking creates a unique
tripId that’s used throughout the system for references in messages, reviews, and transactions.Booking Status
The booking lifecycle is managed through status transitions:Status Flow Diagram
PENDING Status
PENDING Status
When: Tourist has requested a booking but guide hasn’t confirmed yet.Actions Available:
- Tourist can cancel
- Guide can confirm or decline
- Guide can propose alternative times
CONFIRMED Status
CONFIRMED Status
When: Guide has accepted the booking.Actions Available:
- Either party can request changes (
CHANGE_REQUESTED) - Either party can cancel (with
cancelReason) - System auto-transitions to
COMPLETEDafterendDatetime
- Create chat thread for coordination
- Add to guide’s calendar
- Send confirmation notifications
COMPLETED Status
COMPLETED Status
When: Trip has finished successfully.Actions Available:
- Tourist can leave review
- Income transaction is finalized
- Chat thread can be archived
- Trigger review request notification
- Process payment to guide
- Update tour and guide statistics
CANCELLED Status
CANCELLED Status
When: Booking was cancelled by either party.Required:
cancelReason should be provided.Actions Available:- View cancellation reason
- Process refund if applicable
- Archive chat thread
- Remove from guide’s calendar
- Send cancellation notifications
- Handle refund processing
CHANGE_REQUESTED Status
CHANGE_REQUESTED Status
When: Tourist or guide has requested a modification to the booking.Actions Available:
- Review proposed changes
- Accept changes (return to
CONFIRMED) - Decline changes (can lead to
CANCELLED)
- Different date/time
- Modified group size
- Different meeting point
Status History
Every status change is recorded for audit and tracking purposes.Data Model
Use Cases
Audit Trail
Complete history of who changed what and when
Dispute Resolution
Evidence for resolving conflicts between tourists and guides
Analytics
Analyze cancellation patterns and status progression
Customer Support
Help support team understand booking timeline
Tours
Bookings reference tour templates created by guides.Tour Model
Tour Categories
Tours are organized by category:TourCategoryController.java.
Tour Destinations
Tours can include multiple destinations:Included Items
Tours list what’s included:API Endpoints
Trip Bookings
?touristId={id}- Get bookings for a tourist?guideId={id}- Get bookings for a guide?tourId={id}- Get bookings for a tour?status={status}- Filter by status
Trip Status History
?tripId={id}- Get history for a specific trip
Tours
Usage Examples
Creating a Booking
Confirming a Booking
Cancelling a Booking
Integration Points
With Messaging
When a booking is created:With Payments
When booking is confirmed:With Calendar
Update guide’s calendar:Best Practices
Set reminders for upcoming trips by querying bookings with
status=CONFIRMED and startDatetime in the near future.Common Questions
Can tourists book multiple tours with the same guide?
Can tourists book multiple tours with the same guide?
Yes, tourists can create multiple bookings. Each booking gets a unique
tripId and can have different tours, dates, and statuses.What happens if a guide rejects a booking?
What happens if a guide rejects a booking?
The guide would update the status to
CANCELLED with an appropriate cancelReason explaining why they can’t accommodate the booking.How are refunds handled?
How are refunds handled?
Refunds are processed through the income transaction system. When a booking is cancelled, a refund transaction is created with
txnType=REFUND and sign=NEGATIVE to reverse the original payment.Can bookings be modified after confirmation?
Can bookings be modified after confirmation?
Yes, using the
CHANGE_REQUESTED status. Either party can request changes, which must be approved by the other party before returning to CONFIRMED status.Related Features
Chat & Messaging
See how bookings integrate with messaging
Payments
Learn about income transactions
Reviews
Understand post-trip reviews