Overview
The reservation management system allows business owners to monitor, confirm, and cancel customer reservations. All reservation actions trigger automatic email notifications to keep customers informed.Reservation Entity Structure
Reservations in the system have the following structure:source/lib/dominio/entidades/reserva.dart
Viewing Reservations
Business owners can view all reservations for their restaurant:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:302-315
Reservation Filtering
The system retrieves reservations by:Reservation States
Reservations progress through three states:State Transitions
source/lib/dominio/entidades/reserva.dart:35-43
Cancelling Reservations
Business owners can cancel customer reservations through the admin panel:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:320-339
Cancellation Process
When a restaurant cancels a reservation:Cancellation Reasons
Providing a cancellation reason helps maintain customer relations: Good cancellation reasons:- “Table unavailable due to scheduled maintenance”
- “Restaurant closing early for private event”
- “Unexpected staff shortage”
- “Emergency building repairs”
- “Cannot accommodate”
- “Cancelled”
- “Not available”
Email Notifications
All reservation actions trigger automatic email notifications through theServicioEmail class.
Customer Notifications
Customers receive emails for:Reservation Confirmed
Reservation Confirmed
Sent when a new reservation is created and confirmed.Email includes:
- Reservation confirmation badge
- Restaurant name and details
- Table assignment
- Date and time
- Party size
- Important reminders (arrive early, cancellation policy)
source/lib/adaptadores/servicio_email.dart:18-72Cancelled by Customer
Cancelled by Customer
Sent when customer cancels their own reservation.Email includes:
- Cancellation confirmation
- Original reservation details
- Invitation to book again
source/lib/adaptadores/servicio_email.dart:75-116Cancelled by Restaurant
Cancelled by Restaurant
Sent when restaurant cancels customer’s reservation.Email includes:
- Apology and explanation
- Cancellation reason (if provided)
- Original reservation details
- Invitation to rebook
source/lib/adaptadores/servicio_email.dart:119-175Business Owner Notifications
Restaurant owners receive emails for:New Reservation
New Reservation
Notification when a customer creates a new reservation.Email includes:
- Customer contact information
- Reservation details
- Table assignment
- Party size and timing
source/lib/adaptadores/servicio_email.dart:182-222Customer Cancellation
Customer Cancellation
Notification when a customer cancels their reservation.Email includes:
- Cancellation notice
- Original reservation details
- Note that table is now available
source/lib/adaptadores/servicio_email.dart:225-258Email Template Structure
All emails use a consistent HTML template:source/lib/adaptadores/servicio_email.dart:401-436
Reservation Metrics
The admin panel provides analytics on reservation patterns:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:342-445
Available Metrics
Daily Breakdown
Reservations per day for the last 7 days
Monthly Trends
Reservations per month for the last 6 months
Peak Hours
Top 3 busiest time slots
Slow Periods
Top 3 least busy time slots
Peak Hours Analysis
The system analyzes reservation patterns by hour:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:377-402
Metrics only include active reservations (pending and confirmed). Cancelled reservations are excluded from analytics.
Reservation Duration
Each reservation has a duration that determines table availability:Default Duration
The default reservation duration is 60 minutes (1 hour):Custom Durations
Business owners can configure a custom default duration in Business Configuration:- 45 minutes - Quick service restaurants
- 60 minutes - Standard dining (default)
- 90 minutes - Fine dining
- 120 minutes - Multi-course meals
Reservation Conflicts
The system prevents double-booking by checking for conflicts:Conflict Detection
A reservation conflicts with another if:- Both reservations are for the same table
- Time periods overlap
- Neither reservation is cancelled
Advanced Reservation Management
Filtering by Date Range
View reservations for a specific period:Filtering by Status
View only confirmed or pending reservations:Filtering by Table
View reservations for a specific table:Firestore Integration
Reservations are stored in Firestore with the following structure:ReservaRepositorio handles all database operations:
crearReserva(Reserva reserva)- Create new reservationactualizarReserva(Reserva reserva)- Update existing reservationcancelarReserva(String reservaId)- Cancel reservationobtenerReserva()- Get all reservationsobtenerReservaPorId(String id)- Get specific reservation
source/lib/adaptadores/adaptador_firestore_reserva.dart
Best Practices
Monitor Daily Reservations
Monitor Daily Reservations
Check your reservation schedule daily, especially during peak hours:
- Review morning reservations at start of day
- Check afternoon bookings before lunch service
- Verify evening reservations before dinner service
Communicate Cancellations
Communicate Cancellations
Always provide a clear reason when cancelling customer reservations:
- Be honest and specific
- Apologize for the inconvenience
- Offer to help rebook if possible
Use Metrics for Planning
Use Metrics for Planning
Analyze reservation patterns to optimize operations:
- Staff appropriately during peak hours
- Offer promotions during slow periods
- Adjust table arrangements based on popular zones
Maintain Customer Data
Maintain Customer Data
Keep customer contact information accurate:
- Verify email addresses are valid
- Encourage phone verification
- Update customer names when provided
Troubleshooting
Problem: Email Not Sent
Possible causes:- Customer email is missing or invalid
- Firebase Email Extension not configured
- Email quota exceeded
contactoCliente field and check Firebase console for email extension status
Problem: Cannot Cancel Reservation
Possible causes:- Reservation already cancelled
- Database connection issue
- Insufficient permissions
Problem: Metrics Not Updating
Possible causes:- Reservations not associated with restaurant tables
- Date filter excluding recent reservations
negocioId and reservations have valid mesaId
Next Steps
Business Configuration
Configure reservation duration and cancellation policies
Table Management
Manage your restaurant’s table layout
Email Notifications
Learn about the email notification system