| | 1 | == User opens dashboard == |
| | 2 | |
| | 3 | === Actors === |
| | 4 | Admin |
| | 5 | |
| | 6 | === Scenario === |
| | 7 | 1. The admin clicks on the button with their username |
| | 8 | 2. A dashboard with their information, favorited builds and their own builds is displayed. |
| | 9 | {{{ |
| | 10 | SELECT |
| | 11 | username, |
| | 12 | email |
| | 13 | FROM users |
| | 14 | WHERE id = $userId |
| | 15 | LIMIT 1; |
| | 16 | }}} |
| | 17 | |
| | 18 | {{{ |
| | 19 | SELECT |
| | 20 | id, |
| | 21 | user_id, |
| | 22 | name, |
| | 23 | created_at, |
| | 24 | total_price |
| | 25 | FROM build |
| | 26 | WHERE is_approved = false |
| | 27 | ORDER BY created_at DESC; |
| | 28 | }}} |
| | 29 | |
| | 30 | {{{ |
| | 31 | SELECT |
| | 32 | id, |
| | 33 | user_id, |
| | 34 | name, |
| | 35 | created_at, |
| | 36 | total_price |
| | 37 | FROM build |
| | 38 | WHERE user_id = $userId |
| | 39 | ORDER BY created_at DESC; |
| | 40 | }}} |
| | 41 | |
| | 42 | {{{ |
| | 43 | SELECT * |
| | 44 | FROM suggestions |
| | 45 | WHERE status = 'pending' |
| | 46 | ORDER BY id DESC; |
| | 47 | }}} |