| | 1 | == User opens dashboard == |
| | 2 | |
| | 3 | === Actors === |
| | 4 | Guest, User, Admin |
| | 5 | |
| | 6 | === Scenario === |
| | 7 | 1. The user clicks on the "COMPONENTS" dropdown |
| | 8 | 2. A list of all the component types is displayed and the users chooses one |
| | 9 | 3. A popup of all the components of that type is displayed |
| | 10 | {{{ |
| | 11 | SELECT * |
| | 12 | FROM components |
| | 13 | WHERE name ILIKE ('%' || $q || '%') |
| | 14 | ORDER BY |
| | 15 | CASE WHEN $sort = 'price_asc' THEN price END ASC, |
| | 16 | CASE WHEN $sort = 'price_desc' THEN price END DESC, |
| | 17 | price DESC |
| | 18 | LIMIT COALESCE($limit, 100); |
| | 19 | }}} |
| | 20 | 4. The user can sort by price |
| | 21 | 5. The users can view the details of a component by clicking on it |
| | 22 | {{{ |
| | 23 | SELECT * |
| | 24 | FROM components |
| | 25 | WHERE id = $componentId |
| | 26 | LIMIT 1; |
| | 27 | |
| | 28 | SELECT * |
| | 29 | FROM $details_table -- cpu/gpu/memory/storage/power_supply/motherboard/pc_case/cooler/... |
| | 30 | WHERE component_id = $componentId |
| | 31 | LIMIT 1; |
| | 32 | |
| | 33 | -- if type = pc_case: |
| | 34 | SELECT * FROM case_storage_form_factors WHERE case_id = $componentId; |
| | 35 | SELECT * FROM case_ps_form_factors WHERE case_id = $componentId; |
| | 36 | SELECT * FROM case_mobo_form_factors WHERE case_id = $componentId; |
| | 37 | |
| | 38 | -- if type = 'cooler': |
| | 39 | SELECT * FROM cooler_cpu_sockets WHERE cooler_id = $componentId; |
| | 40 | }}} |