MLH-Fellowship / fellow-central

Earn points for yourself and your pod during the MLH Fellowship. Make your activities and participation count.
https://leagueoffellow.netlify.app/
MIT License
6 stars 1 forks source link

Get points for User #34

Closed cqvu closed 3 years ago

cqvu commented 3 years ago

Task(s)

Acceptance Criteria

Dependencies

Resources

Notes

luiszugasti commented 3 years ago

It looks like this is already accumulated in the database - not a good idea for data redundancy purposes. But for now appears to potentially resolve this.

image

luiszugasti commented 3 years ago

From the discord convo, we will be removing the "points_total" column from users.

Anyways, this is very similar to do from the case in #33.

Mock for how to do it in SQLAlchemy (with SQL code):

SELECT * FROM points p LEFT JOIN users u ON u.id = p.assignee WHERE u.name=${user_to_query};

where the user to query is a get parameter from the endpoint call.

I should note that we have to then aggregate on the p.amount column

Again then wrapping it up nicely in a JSON object to be consumed by the front end.