Skip to content

Commit

Permalink
Add Event Registration Feature Full-Stack (#212)
Browse files Browse the repository at this point in the history
Adds functionality to the frontend to allow users to register for/unregister from events.

Major Changes:

* Added a button in the Event Detail Card for users to register/unregister for events.
* Added service methods to the Event Service for getting event registrations/registering/unregistering/etc.
* Created EventMember and EventOrganizer objects to display registered users without exposing all personal information about the users.
* Refactored Event models to store is_registered, is_organizer, organizers, and attendees fields. The latter two fields store EventMember objects to avoid user information exposure.
* Updated frontend to accommodate new backend models and API routes.
* Added an API route to retrieve a paginated list of users registered for an event.
* Added a paginated registrations card to the Event Details page to display users who are registered for an event.
* Added support on the backend and frontend for setting organizers manually (rather than just defaulting to the user creating the event).
* Surfaced the registration limit field onto the frontend and added a form control for setting/updating the registration limit. *Note: Setting the registration limit to 0 when creating/editing an event sets the can_register field to False!

---------

Co-authored-by: Ajay Gandecha <[email protected]>
Co-authored-by: Kris Jordan <[email protected]>
Co-authored-by: Kris Jordan <[email protected]>
  • Loading branch information
4 people authored Dec 31, 2023
1 parent d14707a commit bcaf39b
Show file tree
Hide file tree
Showing 44 changed files with 2,793 additions and 418 deletions.
128 changes: 0 additions & 128 deletions backend/api/events.py

This file was deleted.

15 changes: 15 additions & 0 deletions backend/api/events/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from fastapi import Request
from fastapi.responses import JSONResponse
from backend.services.exceptions import EventRegistrationException


# FastAPI Middleware Exception Handler for ReservationExceptions
def _event_registration_exception_handler(
request: Request, e: EventRegistrationException
):
return JSONResponse(status_code=422, content={"message": str(e)})


exception_handlers = [
(EventRegistrationException, _event_registration_exception_handler)
]
Loading

0 comments on commit bcaf39b

Please sign in to comment.