-
Notifications
You must be signed in to change notification settings - Fork 67
Part 1 of Booking System — Dynamic Calendar, UTC Logic & Test Coverage #4172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… booking-system
Currently stuck on getting Mentor Name and Accepted date
|
I need to get the Mentor/Examiner Name and Accepted Date to display on the tooltip. However, I am racking my brains about pulling from the CTS side of things. If any of the maintainers wishes to input, they can. If the above gets sorted and tested with the correct data, I am happy for it to be pulled in. However, once the above is done, I am going to implement the Register for interest for Events, as a Controller to help list times a controller is available and for what positions are available in the Admin side of things. Once that is done the plan is to implement booking directly from the main site. I do not know if you have anyone whom knows the inner workings of CTS within the team @AxonC if you do can you ask them to help with my first issue of the Mentor/Examiner section of this Comment? |
Bookings now Display For Events, Exams and Mentoring
Due to changes I need to fix the Tests
Fixed Old Bookings not Displaying
Tests and Navigation
|
This is part 1 of the system, then we can discuss it in #4299 regarding the next phase of development for it |
|
Looks great so far, I'll spin it up locally to get a better feel for the UI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When the booking in question is at the bottom of the page, the popover stays mostly hidden on hover
- When I click on a booking, I can then hover over others which overlays the popovers:
- Display old bookings seems to be buggy:
- Old bookings hidden
- Old bookings shown
(note that the date is question is in the future so the button should not have any effect on them
-
The booking JSON api exposes names of trainees for mentoring sessions, I'd honestly just scrap the API, the already is one at /api/cts/bookings
-
We should probably stick to the CTS naming eg.
- Sessions: FirstName FirstSurnameLetter (cid)
- Exams/Mentoring: show mentor/examiner full name + (cid)
- Now that the calendar is in core, I think we could implement permissions where staff members can see names on all bookings while normal users can't
|
@kristiankunc 1 to 3 is done I will double check
|
Not sure what you mean by that? The fact that the data is in the CTS DB should not matter as much and the API you created seems to be redundant and not depended on by the calendar. |
📋 Summary
This PR introduces a modernised Bookings Calendar to replace the legacy CTS integration.
It provides an improved UI, UTC-based time handling, dynamic filtering, and a cleanly structured backend with test coverage.
💡 Motivation
The previous booking calendar was static, CTS-dependent, and lacked timezone awareness or instant filtering.
This overhaul:
⚙️ Implementation Details
🧱 Core Features
🗓️ Bookings Calendar View
resources/views/site/bookings/index.blade.php⚙️ Backend Enhancements
New Library:
App\Libraries\BookingsisPastUtc()helper for consistent UTC-based expiry logic.Updated Repository:
App\Repositories\Cts\BookingRepositoryEX) bookings.fromtime.🧪 Automated Tests
tests/Unit/Bookings/BookingsTest.phpBookings::isPastUtc()logictests/Unit/CTS/BookingsRepositoryTest.phptests/Feature/Bookings/CalendarViewPastClassTest.php.is-pastclass rendering in Blade templates🖥️ Frontend Improvements
resources/views/components/nav.blade.php)@yield('scripts')to Blade for page-scoped JavaScript🧩 Developer Notes
.is-pastclass).✅ Testing Instructions
Visit
/bookings/calendar✅ Past bookings hidden by default
✅ “Display Old Bookings” toggle works instantly
✅ “Show Times in Local Time” converts correctly
✅ Filters by type apply instantly
✅ Live Local & UTC clocks update every second
🧾 Changelog Summary
App\Libraries\Bookingsfor UTC-based past booking checksBookingRepositorywith unified formatting & privacy🗂️ Implementation Diff Summary
Click to expand
Added
app/Libraries/Bookings.php— Shared UTC logic for expired bookingstests/Unit/Bookings/BookingsTest.php— Unit test forisPastUtc()tests/Feature/Bookings/CalendarViewPastClassTest.php— Blade render testModified
app/Repositories/Cts/BookingRepository.php→ Improved formatting, consistent time handling, and privacy logic.
resources/views/site/bookings/index.blade.php→ Fully reworked calendar layout and dynamic filtering support.
resources/views/components/nav.blade.php→ Added “Bookings Calendar” menu entry.
Support
@yield('scripts')for page-specific JS injection📸 Visual Overview (optional)
Add these when available:
🧭 Next Steps / Future Enhancements
🧱 Technical Summary
App\Libraries\BookingsCts\Bookingmodel🔖 PR Checklist