#73 Booking Availability and Endpoints#129
Conversation
a40dc29 to
405578a
Compare
omgdory
left a comment
There was a problem hiding this comment.
✅ Approval Overview
Admin panel updated and has appropriate fields. Managers added for more easy database handling related to this model. Migrations applied. Model fields look appropriate. Serializers look good. URLs make sense. GET and POST views seem appropriate.
🧠 Details
This model's design considers the necessary fields to capture availability details accurately. One thing to note is that the existing Booking model must be added as a field under the model. However, this can be done in a future PR, as we now have the foundation for the model established.
The API endpoints enable basic CRUD operations. All that is left on this front is adding appropriate authentication. Once again, this can be done later, as we have a foundation.
The modifications on the Booking model should include unit and integration tests, as this would help to validate that existing functionality is not hindered. As mentioned in the meeting, though, testing can be done in a separate PR.
Overall, this PR provides a good foundation for implementing the Availability model into existing systems.
🎯 Next Steps
Add booking field as defined in the issue. Add authentication for CRUD operations. Implement unit testing.
ashley-arellano
left a comment
There was a problem hiding this comment.
🔍 Peer Review: Great Job on This PR!
Hey CJ 👋 — just finished reviewing your PR titled "#73 Booking Availability and Endpoints". Here’s my feedback:
✅ What Looks Great
-
The GET and POST views for bookings are working perfectly
- Just had to add a
create/URL tourls.pyto get POST working
- Just had to add a
-
The new
Availabilitymodel is great. Good use of constraints, clean validation logic, and ordering! -
It great that you moved some logic into
managers.py. That refactoring makes the codebase more maintainable.
💡 Suggestions for Improvement (if any)
These are ideas for future improvements or things to address before merging.
-
As mentioned, I had to add a url to
urls.pyto get POST to work. So I would suggest adding a new POST URL tourls.py(e.g.,path('create/', views.create_booking, name='create_booking')) to make sure the endpoint is accessible. -
Could include unit tests for the new
Availabilitymodel and views if not already there.
🧪 Tested This Feature
I ran the following test steps:
-
✅ Ran the
GET /bookings/availability/endpoint via CURL and it returned correct results. -
✅ Ran the
POST /bookings/create/endpoint with test data via CURL and it created the booking successfully. -
✅ Confirmed that the new views and model integrate cleanly with the rest of the system.
🔄 Next Steps
- Add a url path to
urls.py - Adding unit tests later on to boost our test coverage
🚀 Final Thoughts
Great job with this implementation! It’s a great addition to our project. Therefore, I will approve : D
Booking Availability and Endpoints
Overview
What does this PR do?
Adds an availability model that works alongside the bookings model as well as simple
GETandPOSToperations.Key Features & Changes
What has been added or changed?
managers.pymanagers.pyis populated with methods moved frommodels.pyserializers.pyGETview for Availability to get openings by tutor and date.POSTview for Availability to book a session based on availabilities fetched withGETusers/models.pyto properly display profile username in admin model and any developer tools. Before if the first name/last name wasn't populated, it would not show anything.Why This Is Needed
What problem does this solve?
Implements #73
How to Test This PR
Step-by-step testing guide
views.py, uncomment around line 73, which will show you all the availabilities that you created.settings.py, as you won't be able to access anything.AI Code Usage
🤖 Was AI-generated code used in this PR?
Checklist for Reviewers
Things to check before approving this PR:
Final Notes
Thank you for reviewing! Please leave feedback if you have any suggestions or concerns. Let’s make this feature even better!