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

Enforce one-to-one relationships #690

Open
logan-r opened this issue Jan 28, 2021 · 4 comments · May be fixed by #775
Open

Enforce one-to-one relationships #690

logan-r opened this issue Jan 28, 2021 · 4 comments · May be fixed by #775
Assignees
Labels
bug Something isn't working Pri 1 Medium priority

Comments

@logan-r
Copy link
Member

logan-r commented Jan 28, 2021

Describe the bug
Can associate multiple Hackers with accounts or multiple rolebindings with accounts

To Reproduce
Steps to reproduce the behavior:

  1. Create an Account
  2. 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

@logan-r logan-r added bug Something isn't working Pri 1 Medium priority labels Jan 28, 2021
@logan-r logan-r self-assigned this Jan 28, 2021
@krubenok
Copy link
Member

krubenok commented Jan 28, 2021

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: #650

@pierreTklein
Copy link
Member

This is definitely a massive undertaking

@logan-r
Copy link
Member Author

logan-r commented Jan 28, 2021

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?

@krubenok
Copy link
Member

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.

@brarsanmol brarsanmol linked a pull request Jan 21, 2022 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Pri 1 Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants