hackerAPI
hackerAPI copied to clipboard
Enforce one-to-one relationships
Describe the bug Can associate multiple Hackers with accounts or multiple rolebindings with accounts
To Reproduce Steps to reproduce the behavior:
- Create an Account
- Create two Hackers associated with that Account
Expected behavior Attempt to create the second hacker would fail
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Had 2 or 3 Hackers associated with a handful of accounts during the 2021 McHacks application period
Sounds like the proper long term solution for this is a DB re-arch that nests the hacker object for a given instance of the hackathon within the account object. I think we've discussed this in another issue somewhere else.
Edit lol yup: https://github.com/hackmcgill/hackerAPI/issues/650
This is definitely a massive undertaking
With the level of effort #650 would take, maybe a better approach to the redesign would be to wrap this API in a GraphQL api and then slowly remove and replace REST parts?
I think there's a real discussion to be had on if going from REST to GQL is actually the correct architecture for an API like this. My gut says that GQL is probably overkill for this application, but I could be convinced otherwise. That being said, the admin side would get some nice benefits out of GQL that the hacker side might not see as much of.
Either way, the way Mongo is being used right now is fundamentally wrong so that needs to be addressed.