-
Notifications
You must be signed in to change notification settings - Fork 5
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
Teams can create own tech categories #208
Conversation
…ies for all seed teams
…ation in swagger response
haven't looked at the code yet but saw this in the lint and test workflow, we need to make it nullable or set a default value. At this stage of the project I don't think it matters what we do since prod will be wiped after the alpha test or before the next test phase. Probably better to set a default value because we don't want it null. But we need to remove the default value after the new schema is pushed/deployed to all databases. thoughts? |
…m/chingu-x/chingu-dashboard-be into feature/teams-own-tech-categories
I changed the voyageTeamId relation to optional, even though I don't think it should be. It passed the check - It looks like the other relations are done this way too. |
sounds good. I think some of the relations are nullable because I needed to do that to set up "onDelete" referential actions on team deletion, when I don't want to cascade delete, there are probably better ways we can look into that later. It will probably be a lot more relavent when we are working on the admin dashboard |
removed @Ajen07 as a reviewer as he'll be away for 2 weeks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prisma/migrations/20240906130941_techstack_category_teamid/migration.sql
Outdated
Show resolved
Hide resolved
Yes that's right - I actually tried removing this param from the controller, but the response sent an error that said "URL shouldn't be empty". I couldn't find the source of the message. Should I remove voyageTeamId from the body? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All unit and e2e tests passed. db shows 66 categories for 11 teams. Also the POST techCategory endpoint throw an exception and is case-sensitive for duplicate category names on the same team id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is good. I have tested on swagger everything listed in the description works, I just have some questions and very minor changes requested
I assume tests would be added/updated in later parts? Maybe new tests for categories, and update old tests if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just randomly discovered this bug, but I think this may not be in the scope of this PR?
voyageTeam 1 doesn't own category 51, and I logged in as dan who is in voyageTeam1 but not in the team which owns category 51 (team 9)
====
Other things i've manually tested and all worked
- create a new tech stack category, throw 409 when duplicated (non case sensitive) as expected
- added the same category to different teams
- try to add category to someone elses team (403)
- patch (own team and other teams)
- delete (own team and other teams)
I don't think it's specific to this PR but it could be related. |
In my database dan is not an admin, his only role is "voyager" but yeah if you want to fix this in another parts its fine, it's not a huge issue which stops the app from working. |
hi @timDeHof are you able to re- review this PR please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests passed! migrating db works. Also the preventing the duplicate tech category name works.
Description
This PR completes the first part of task 86b1ym631
adds 3 routes for team tech stack categories (create, update, delete)
These are located in the techs section of the API
Now, each team will have it's own instances of the 6 main categories, and can also create their own
The schema for tech stack categories has been updated, along with seed data
Issue link
Fixes # 86b1ym631
Type of change
How Has This Been Tested?
Migrate for DB updates and seed:
npx prisma migrate dev
Test routes in swagger
Verify in DB: 66 categories for 11 teams
Verify duplicate category names for the same teamId throw an exception, and are case-insensitive - i.e. "TEST" === "Test"
Checklist: