additional features, refinement and more control over the app from admin side, better bookings UX

This commit is contained in:
mikicvi
2025-09-25 20:23:18 +01:00
parent 6d3202e385
commit b89d91ade2
20 changed files with 1358 additions and 328 deletions
+44 -38
View File
@@ -9,13 +9,14 @@ This update introduces two major features to the table tennis booking system:
The system now supports different booking hours for different days of the week. Administrators can configure custom time slots for each day (Sunday through Saturday).
#### Example Configuration:
- **Sunday**: 12:00 - 17:00 (Weekend afternoon sessions)
- **Monday**: 19:00 - 23:00 (Evening sessions only)
- **Tuesday**: 19:00 - 23:00 (Evening sessions only)
- **Wednesday**: 18:00 - 22:00 (Shorter evening sessions)
- **Thursday**: 19:00 - 23:00 (Evening sessions only)
- **Friday**: 18:00 - 22:00 (Shorter evening sessions)
- **Saturday**: 10:00 - 18:00 (Full day weekend sessions)
- **Sunday**: 12:00 - 17:00 (Weekend afternoon sessions)
- **Monday**: 19:00 - 23:00 (Evening sessions only)
- **Tuesday**: 19:00 - 23:00 (Evening sessions only)
- **Wednesday**: 18:00 - 22:00 (Shorter evening sessions)
- **Thursday**: 19:00 - 23:00 (Evening sessions only)
- **Friday**: 18:00 - 22:00 (Shorter evening sessions)
- **Saturday**: 10:00 - 18:00 (Full day weekend sessions)
### 2. User Name Display
@@ -42,36 +43,40 @@ CREATE TABLE time_slots (
### API Endpoints
#### Public Endpoints (for authenticated users):
- `GET /api/time-slots` - Retrieve active time slots for all days
- `GET /api/bookings/all?date=YYYY-MM-DD` - Get all bookings with user and court information
- `GET /api/time-slots` - Retrieve active time slots for all days
- `GET /api/bookings/all?date=YYYY-MM-DD` - Get all bookings with user and court information
#### Admin Endpoints:
- `GET /api/admin/time-slots` - Retrieve all time slots (including inactive)
- `POST /api/admin/time-slots` - Create new time slot
- `PUT /api/admin/time-slots/[id]` - Update existing time slot
- `DELETE /api/admin/time-slots/[id]` - Delete time slot
- `GET /api/admin/time-slots` - Retrieve all time slots (including inactive)
- `POST /api/admin/time-slots` - Create new time slot
- `PUT /api/admin/time-slots/[id]` - Update existing time slot
- `DELETE /api/admin/time-slots/[id]` - Delete time slot
### Admin Management
Administrators can manage time slots through the admin dashboard under the "Settings" tab. The interface allows:
- **Create Time Slots**: Set day of week, start time, end time, and active status
- **Edit Time Slots**: Modify existing time slot configurations
- **Delete Time Slots**: Remove time slot configurations
- **Activate/Deactivate**: Toggle time slots on/off without deletion
- **Create Time Slots**: Set day of week, start time, end time, and active status
- **Edit Time Slots**: Modify existing time slot configurations
- **Delete Time Slots**: Remove time slot configurations
- **Activate/Deactivate**: Toggle time slots on/off without deletion
### User Experience
#### Enhanced Booking Calendar:
- Automatically adapts to show only available time slots for the selected day
- Displays who has booked each unavailable slot
- Maintains mobile-responsive design
- Provides fallback to global settings if no day-specific slots are configured
- Automatically adapts to show only available time slots for the selected day
- Displays who has booked each unavailable slot
- Maintains mobile-responsive design
- Provides fallback to global settings if no day-specific slots are configured
#### Booking Display:
- Available slots: Green background with "Book" button
- Booked slots: Red background showing "Booked by [Full Name]"
- Clear visual distinction between available and booked slots
- Available slots: Green background with "Book" button
- Booked slots: Red background showing "Booked by [Full Name]"
- Clear visual distinction between available and booked slots
## Usage Instructions
@@ -79,10 +84,10 @@ Administrators can manage time slots through the admin dashboard under the "Sett
1. **Navigate to Admin Dashboard** → Settings tab
2. **Time Slot Management section** allows you to:
- Add new time slots for specific days
- Edit existing time slot configurations
- View all time slots organized by day of the week
- Activate/deactivate time slots as needed
- Add new time slots for specific days
- Edit existing time slot configurations
- View all time slots organized by day of the week
- Activate/deactivate time slots as needed
### For Users:
@@ -93,11 +98,11 @@ Administrators can manage time slots through the admin dashboard under the "Sett
## Technical Benefits
- **Flexible Scheduling**: Different operational hours for different days
- **User Transparency**: Know who's playing when for coordination
- **Administrative Control**: Easy management of time slots
- **Backward Compatibility**: Maintains fallback to global settings
- **Mobile Optimized**: Responsive design across all devices
- **Flexible Scheduling**: Different operational hours for different days
- **User Transparency**: Know who's playing when for coordination
- **Administrative Control**: Easy management of time slots
- **Backward Compatibility**: Maintains fallback to global settings
- **Mobile Optimized**: Responsive design across all devices
## Migration
@@ -106,8 +111,9 @@ The system includes database seeding scripts that populate initial time slots ba
## Future Enhancements
Potential future improvements could include:
- Seasonal time slot variations
- Holiday-specific scheduling
- Automatic time slot generation tools
- Bulk time slot operations
- Time slot templates for quick setup
- Seasonal time slot variations
- Holiday-specific scheduling
- Automatic time slot generation tools
- Bulk time slot operations
- Time slot templates for quick setup