Skip to content
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

Add backend for bookable office hours #324

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dkwncho
Copy link

@dkwncho dkwncho commented Nov 18, 2024

  • Created new Booking model, serializer, permission, urls, and viewset

Note: These changes will not be fully functional until the Occurrence model in schedule.models is updated (pull request is open in the django-schedules repository with those minor changes)

- Created new Booking model, serializer, permission, urls, and viewset
Copy link
Contributor

@benjmnxu benjmnxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an issue with the Booking creation logic–please read my comment on it. Otherwise, I think we're pretty close to getting this merged. I'd encourage you to write some tests too.

backend/ohq/models.py Outdated Show resolved Hide resolved
backend/ohq/models.py Outdated Show resolved Hide resolved
backend/ohq/views.py Outdated Show resolved Hide resolved
backend/ohq/permissions.py Outdated Show resolved Hide resolved
serializer_class = BookingSerializer
permission_classes = [BookingPermission | IsSuperuser]

def create(self, request, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we only allowed to create bookings in chronological order? For example, if an occurrence is from 1-3pm and no other bookings existed, I would only be able to book a slot at 1pm. If someone had booked starting at 1pm, I would only be able to book a 1:30pm spot (assuming interval is 30mins).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants