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 a Pod #33

Closed cqvu closed 3 years ago

cqvu commented 3 years ago

Task(s)

Acceptance Criteria

Dependencies

Resources

Notes

luiszugasti commented 3 years ago

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.role=${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

In order to do this for multiple pods, we remove the WHERE clause and instead use the GROUP BY p.role part of the call.

Then wrap this up nicely in a JSON object to be consumed by the front end.