Overview
The table management system allows business owners to configure their restaurant’s table layout, including table names, capacities, and zone assignments.Table Entity Structure
Each table in the system has the following properties:source/lib/dominio/entidades/mesa.dart
Table Capacity Logic
Tables use intelligent capacity matching to optimize seating:Capacity Matching Rules
Examples
| Table Capacity | Party Size | Can Accommodate? | Reason |
|---|---|---|---|
| 4 | 2 | ✅ Yes | Difference is 2 (≤ 3) |
| 4 | 4 | ✅ Yes | Exact match |
| 6 | 6 | ✅ Yes | Exact match |
| 8 | 4 | ❌ No | Difference is 4 (> 3) - table too large |
| 4 | 5 | ❌ No | Capacity too small |
| 6 | 3 | ✅ Yes | Difference is 3 (≤ 3) |
source/lib/dominio/entidades/mesa.dart:16-30
Adding Tables
Business owners can add new tables through the admin panel:Add Table Process
source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:262-281
Required Information
When adding a table, you must provide:Table Name
Table Name
A unique identifier for the table within your restaurantExamples:
- “Mesa 1”, “Mesa 2”, etc.
- “VIP 1”, “VIP 2”
- “Terraza A”, “Terraza B”
- “Barra 1”
Capacity
Capacity
Number of people the table can comfortably seatCommon capacities:
- 2 people (couples/small tables)
- 4 people (standard tables)
- 6 people (family tables)
- 8+ people (large groups)
Zone
Zone
The section or area where the table is locatedDefault zones:
- “Salón” (Main dining room)
- “Terraza” (Outdoor patio)
Editing Tables
Update existing table information:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:283-290
Editable Properties
You can modify:- ✅ Table name
- ✅ Table capacity
- ✅ Zone assignment
- ❌ Table ID (system-generated)
- ❌ Business ID (fixed to restaurant)
Deleting Tables
Remove tables that are no longer in use:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:292-299
Viewing Restaurant Tables
Retrieve all tables for your restaurant:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:258-260
Zone Management
Zones help organize tables by location or purpose.Default Zones
Every restaurant starts with two default zones:source/lib/dominio/entidades/negocio.dart:35
Custom Zones
Business owners can add custom zones to match their layout:source/lib/presentacion/pantalla_dueno/pantalla_dueno_cubit.dart:104-116
Zone Use Cases
Indoor vs Outdoor
Separate indoor seating from outdoor terraces or patios
VIP Areas
Designate special sections for premium seating
Bar Seating
Distinguish bar-height seating from dining tables
Private Rooms
Mark private dining areas or party rooms
Firestore Data Structure
Tables are stored in Firestore with the following structure:MesaRepositorio handles all database operations:
agregarMesa(Mesa mesa)- Add new tableactualizarMesa(Mesa mesa)- Update existing tableeliminarMesa(String mesaId)- Delete tableobtenerMesasPorNegocio(String negocioId)- Get all tables for a restaurantobtenerMesa(String mesaId)- Get specific table by ID
source/lib/adaptadores/adaptador_firestore_mesa.dart
Best Practices
Consistent Naming
Consistent Naming
Use a consistent naming scheme for easy identification:
- Number-based: “Mesa 1”, “Mesa 2”, “Mesa 3”
- Zone-based: “Terraza A”, “Terraza B”
- Type-based: “VIP 1”, “Bar 1”
Accurate Capacities
Accurate Capacities
Set realistic capacities that match physical table sizes:
- Don’t overestimate to avoid cramped seating
- Consider table shape (round, square, rectangular)
- Account for accessibility requirements
Logical Zones
Logical Zones
Organize zones to match your physical layout:
- Use customer-facing zone names
- Group similar seating types together
- Consider different service areas
Regular Updates
Regular Updates
Keep table configuration current:
- Update when rearranging layout
- Remove tables that are permanently retired
- Add seasonal seating (outdoor tables)
Common Scenarios
Scenario 1: Seasonal Patio Tables
For restaurants with seasonal outdoor seating:Scenario 2: Event Configuration
For special events requiring table rearrangement:Scenario 3: Renovation
During restaurant renovations:Integration with Reservations
Tables integrate directly with the reservation system:Availability Checking
When customers search for availability, the system:- Retrieves all tables for the restaurant
- Filters tables by zone preference (if specified)
- Checks table capacity using
puedeAcomodar() - Verifies no conflicting reservations exist
- Returns available table options
Reservation Assignment
When creating a reservation:Each reservation is tied to a specific table through the
mesaId field.Troubleshooting
Problem: Table Not Appearing in Availability
Possible causes:- Table capacity doesn’t match party size within ±3 people rule
- Table has conflicting reservation at requested time
- Table zone doesn’t match customer filter
Problem: Cannot Delete Table
Possible causes:- Table has active or future reservations
- Database connection issues
- Insufficient permissions
Problem: Zone Not Displaying
Possible causes:- Zone list not updated in business configuration
- Table assigned to non-existent zone
Next Steps
Reservation Management
Learn how to manage customer reservations on your tables
Business Configuration
Configure business hours and reservation rules