MarisiaS / SMM

0 stars 0 forks source link

BE-Register events to meet #65

Closed MarisiaS closed 6 months ago

MarisiaS commented 6 months ago

This PR addresses issue #51

Implementation

  1. backend/api/models.py

Implemented the MeetEvent model with the following fields:

Added a unique constrain to meet and num_event

  1. backend/api/migrations/0012_meetevent_meetevent_unique_num_event_meet.py

Generated with command makemigrations.

  1. backend/api/serializers/MeetEventSerializer.py
  1. backend/api/views/MeetEventView.py

Created an APIView named MeetEventView with:

  1. backend/api/urls.py

Added the following endpoint:

Swagger

All new endpoints are accessible through Swagger. Each endpoint has been tested successfully, including listing all events associated with a swim meet, adding an event to a swim meet, and deleting an event from a swim meet.

MarisiaS commented 6 months ago

Could a meet have more than one record of the same event type associated?

I think that's ok because they could have semifinal and final for the same event. But maybe then we should add an extra identifier to the name.