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

[Backend] Implementing event application functionality #275

Closed
KeremZaman opened this issue Dec 24, 2021 · 1 comment · Fixed by #276
Closed

[Backend] Implementing event application functionality #275

KeremZaman opened this issue Dec 24, 2021 · 1 comment · Fixed by #276

Comments

@KeremZaman
Copy link
Collaborator

We need to implement the functionality for users to apply any event as spectator or player and event hosts should be able to accept or reject applications.

For this purpose, I'm planning to implement following API endpoints:

POST 'api/posts/<id>/apply'

  • Parameters
    Parameter Description Parameter Type Data Type
    id ID of the event to apply Path Int
    user_id ID of the user applying to the event Body Int
    type Type of the applicant (spectator/player) Body String

GET'api/posts/<id>/applicants'

  • Parameters
    Parameter Description Parameter Type Data Type
    id ID of the event Path Int

POST 'api/posts/<post_id>/applicants/<applicant_id>'

  • Parameters
    Parameter Description Parameter Type Data Type
    post_id ID of the event Path Int
    user_id ID of the applicant Path Int
    accept status of the applicant Body Bool
@KeremZaman KeremZaman self-assigned this Dec 24, 2021
KeremZaman pushed a commit that referenced this issue Dec 26, 2021
- Add API endpoint for applying to an event as spectator or player
- Add age and capacity checks for applicants
- Add API endpoint for accepting or rejecting applicants for an event by owner of the event
- Add capacity check while accepting applicants
- Change Eventpost model to have 2 different fields for spectator applicants and player applicants
KeremZaman pushed a commit that referenced this issue Dec 26, 2021
- Add tests for applying as player or spectator, applying in full capacity situations, applying when not qualified for the event, accepting player or spectator, rejecting player or spectator, accepting in full capacity scenarios and fetching applicant list
@KeremZaman
Copy link
Collaborator Author

I implemented the functionality along with unit tests. I needed to update eventpost model for convenience to access spectator and player applicants. Also, I changed the API I proposed above a bit. The final API is as following:

POST 'api/posts/<id>/apply'

  • Parameters
    Parameter Description Parameter Type Data Type
    id ID of the event to apply Path Int
    user ID of the user applying to the event Body Int
    type Type of the applicant (spectator/player) Body String

GET 'api/posts/<id>/applicants'

  • Parameters
    Parameter Description Parameter Type Data Type
    id ID of the event Path Int
    type Type of the applicant (spectator/player) Query String

POST 'api/posts/<id>/applicants'

  • Parameters
    Parameter Description Parameter Type Data Type
    id ID of the event Path Int
    type Type of the applicant (spectator/player) Body String
    user ID of the user applying to the event Body Int
    owner ID of the user hosts the event Body Int
    accept status of the applicant Body Bool

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

Successfully merging a pull request may close this issue.

2 participants