Refactor timetable API with user calendars, attendance tracking, iCal import/export, and subscription system #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a comprehensive refactoring of the timetable API to enhance it as a modern calendar service while maintaining all existing functionality. The changes address the original request for iCal support, user authentication integration, and attendance functionality.
🚀 Major Features Added
Personal Calendar Management
.icsfilesAdvanced iCal Import/Export System
.icsfiles with detailed validation and error reportingEvent Attendance Tracking
Calendar Subscription System
Webhook Integration Framework
🏗️ Technical Implementation
Database Schema Extensions
New API Endpoints (25+ endpoints added)
Attendance Management
POST /event/{id}/attendance/- Mark attendance with statusGET /event/{id}/attendance/me- Get user's attendance statusGET /event/{id}/attendance/list- List all attendees with countsPersonal Calendar
POST /user/events- Create personal eventsGET /user/calendar- Combined personal + subscription viewGET /user/calendar.ics- Export as iCal with subscriptionsSubscriptions
POST /subscriptions/group/{id}- Subscribe to group calendarPOST /subscriptions/lecturer/{id}- Subscribe to lecturer calendarGET /subscriptions/- List active subscriptionsiCal Import/Export
POST /import/ical/preview- Preview calendar before importPOST /import/ical- Import as personal events with detailed resultsPOST /import/ical/admin- Import institutional events (admin-only)Webhook Management
POST /webhooks/- Register webhook with event filteringGET /webhooks/- List registered webhooksAuthentication Integration
UnionAuthsystem🧪 Testing & Quality
Comprehensive Test Coverage
Error Handling
🔧 Migration & Backwards Compatibility
Database Migrations
API Compatibility
GET /event?format=ics) enhanced but unchanged📋 Usage Examples
Creating and Managing Personal Calendar
Import External Calendar
Track Event Attendance
🎯 Benefits
🔮 Future Phases Ready for Implementation
The implementation provides a solid foundation for additional phases:
This refactoring transforms the timetable API from a basic scheduling service into a comprehensive calendar platform while maintaining full backwards compatibility and adding significant value for users.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.