Implement upvote and downvote reactions for projects.
Preferable prerequisites: #6 #2
Requirements
-
Database Schema Update:
- Create a new table to store reactions:
- This table will store:
project_id: The ID of the project being reacted to. Needs to be of UUID type.
reactor_id: The ID of the user reacting.
time: The timestamp when the reaction was made.
reaction_type: The type of reaction (upvote or downvote)
- Create corresponding types in TypeScript for frontend and Go for backend.
-
Adjusting Project Score:
- Modify the
Projects table to include a score column
- Implement logic to update the score based on reactions:
- If the reaction is an upvote, increment the score.
- If the reaction is a downvote, decrement the score.
-
Sorting Projects:
Acceptance Criteria
- Users can upvote or downvote a project.
- Reactions are stored in the new
Reactions table.
- The project score is updated correctly based on reactions.
- Projects are displayed in order of score on the Project page.
Additional Notes:
- Ensure proper testing for the new functionality and database changes.
Implement upvote and downvote reactions for projects.
Preferable prerequisites: #6 #2
Requirements
Database Schema Update:
project_id: The ID of the project being reacted to. Needs to be of UUID type.reactor_id: The ID of the user reacting.time: The timestamp when the reaction was made.reaction_type: The type of reaction (upvote or downvote)Adjusting Project Score:
Projectstable to include ascorecolumnSorting Projects:
Acceptance Criteria
Reactionstable.Additional Notes: