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;
Last modified
11 minutes ago
Last modified on 12/29/25 01:04:14
Attachments (1)
- userDashboard.png (77.1 KB ) - added by 11 minutes ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.

