Booking & Reservation System
Concordia’s booking system enables customers to reserve services with providers through an availability-based scheduling system with status management and cancellation policies.Overview
The booking system consists of two main components:- Availability Schedules (
services_availability.schema.ts) - Provider defines when they’re available - Bookings (
services_bookings.schema.ts) - Customer reservations of specific time slots
Availability Management
Fromsrc/database/schemas/services_availability.schema.ts:
Availability Fields
text
required
Unique availability entry identifier
text
required
Reference to the service listing
integer
required
Day of the week using numeric representation:
0= Sunday1= Monday2= Tuesday3= Wednesday4= Thursday5= Friday6= Saturday
text
required
Start time in 24-hour HH:MM formatExample:
"09:00", "14:30"text
required
End time in 24-hour HH:MM formatExample:
"17:00", "18:30"boolean
default:true
Whether this time slot is currently available for bookingSet to
false to temporarily block a recurring time slot without deleting ittimestamp
required
When this availability entry was created
Unique Constraint
The schema enforces uniqueness on(serviceId, dayOfWeek, startTime) to prevent duplicate time slots:
Recurring Weekly Schedule
Availability entries define a recurring weekly schedule. For example:- Monday: Available 9am-12pm and 2pm-5pm
- Wednesday: Available 9am-5pm
Multiple availability windows per day are supported, perfect for providers with lunch breaks or split schedules.
Booking Management
Fromsrc/database/schemas/services_bookings.schema.ts:
Core Booking Fields
text
required
Unique booking identifier
text
required
Reference to the service being booked
text
required
User ID of the customer making the booking
text
required
User ID of the service provider
Schedule Details
text
required
Date of the service in YYYY-MM-DD formatExample:
"2026-03-15"text
required
Start time of the service in HH:MM formatExample:
"14:00"integer
required
Duration of the booked service in minutesExample:
90 for 1.5 hoursThe combination of
bookingDate, bookingTime, and durationMinutes defines the exact time slot reserved.Payment Information
text
Final price as a string for decimal precisionExample:
"75.00"text
default:"EUR"
ISO 4217 currency codeExample:
"EUR", "USD", "GBP"Booking Status
text
default:"pending"
Current booking status with possible values:
pending- Awaiting provider confirmationconfirmed- Provider has confirmed the bookingcompleted- Service has been deliveredcancelled- Booking was cancelledno_show- Customer didn’t show up
Communication
text
Optional message from customer to providerExample:
"I need wheelchair access. Is that available?"text
Provider’s response to the booking or customer messageExample:
"Yes, we have wheelchair access. See you at 2pm!"Lifecycle Timestamps
timestamp
When the booking was cancelled (if applicable)Only set when status transitions to
cancelledtimestamp
When the service was marked as completedSet when status transitions to
completedtimestamp
required
When the booking was initially created
timestamp
required
Last modification time, automatically updated
Booking Status Workflow
Status Transitions
Provider accepts the booking requestTypically within 24-48 hours of booking
Either party cancels before confirmationSets
cancelledAt timestampService successfully deliveredSets
completedAt timestamp, enables reviewCancellation after confirmationMay have policy implications (see cancellation policies)
Customer didn’t attend appointmentProvider marks as no-show
Cancellation Policies
Fromservices_listings.schema.ts, services define cancellation rules:
integer
Minimum hours in advance required for bookingExample:
24 means customers must book at least 1 day aheadinteger
Hours before service when free cancellation is allowedExample:
48 means free cancellation up to 2 days beforeExample Policy Enforcement
Database Indexes
From the schema files:Availability Indexes
Booking Indexes
Indexes support efficient queries for:
- All bookings for a service
- Customer’s booking history
- Provider’s booking calendar
- Bookings by status for dashboards
- Bookings by date for calendar views
Integration with Services
Fromservices_listings.schema.ts, the relationship is defined:
- Multiple availability windows (recurring weekly schedule)
- Multiple bookings (past and future reservations)
Booking Flow Example
1. Provider Sets Availability
2. Customer Requests Booking
3. Provider Confirms
4. Service Completed
Conflict Prevention
To prevent double-booking:- Check availability - Verify day/time matches an active availability entry
- Check existing bookings - Ensure no overlapping confirmed bookings
- Consider duration - Account for service duration when checking conflicts
Best Practices
For Providers
- Set realistic availability - Only mark times you can reliably serve customers
- Use
isAvailable: false- Temporarily block slots without deleting recurring schedule - Respond promptly - Confirm or decline bookings within 24 hours
- Communicate clearly - Use
providerResponsefor important details
For Booking System
- Validate against availability - Check day/time matches provider schedule
- Prevent double-booking - Lock slots or use transactions
- Enforce policies - Respect
bookingAdvanceHoursandcancellationHours - Send notifications - Email/notify on booking, confirmation, cancellation
- Enable reviews - Only allow reviews for
completedbookings
For Customers
- Book in advance - Respect
bookingAdvanceHoursrequirement - Provide details - Use
customerMessagefor special requests - Cancel early - Follow
cancellationHourspolicy for free cancellation - Leave reviews - Help other customers after
completedbookings