| Version 3 (modified by , 8 hours ago) ( diff ) |
|---|
User opens dashboard
Actors
User
Scenario
- The user clicks on the button with their username
- A dashboard with their information, favorited builds and their own builds is displayed.
SELECT username, email FROM users WHERE id = $userId LIMIT 1;
SELECT id, user_id, name, created_at, total_price FROM build WHERE user_id = $userId ORDER BY created_at DESC;
SELECT b.id, b.user_id, b.name, b.created_at, b.total_price, COALESCE(AVG(rb.value::float), 0) AS avgRating FROM build AS b INNER JOIN favorite_build AS fb ON b.id = fb.build_id LEFT JOIN rating_build AS rb ON b.id = rb.build_id WHERE fb.user_id = $userId GROUP BY b.id, b.user_id, b.name, b.created_at, b.total_price ORDER BY COALESCE(AVG(rb.value::float), 0) DESC;
Attachments (2)
- userDashboard.png (77.1 KB ) - added by 8 hours ago.
- clickUsername.png (76.7 KB ) - added by 8 hours ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.


