| | 1 | = UC0001 Prototype Implementation - Browse Available Resources = |
| | 2 | |
| | 3 | '''Initiating actor:''' Student (also available to Teaching Staff and Administrator) |
| | 4 | |
| | 5 | '''Other actors:''' None |
| | 6 | |
| | 7 | The user browses all resources in the system with options to filter by type or building, view detailed information about a specific resource including its upcoming reservations, and check whether a resource is available at a specific date and time. |
| | 8 | |
| | 9 | == Scenario == |
| | 10 | |
| | 11 | 1. The user selects ''Browse Available Resources'' from the main menu. The system runs the following query: |
| | 12 | {{{ |
| | 13 | SELECT r.resource_id, r.name, r.description, |
| | 14 | r.available_from, r.available_to, r.available_weekends, |
| | 15 | rt.type_name, rt.is_physical, |
| | 16 | l.building, l.room |
| | 17 | FROM resources r |
| | 18 | JOIN resource_types rt ON r.type_id = rt.type_id |
| | 19 | LEFT JOIN locations l ON r.location_id = l.location_id |
| | 20 | ORDER BY rt.type_name, r.name; |
| | 21 | }}} |
| | 22 | |
| | 23 | The system displays all resources as a numbered list with a sub-menu: |
| | 24 | {{{ |
| | 25 | === Browse Resources (27 found) === |
| | 26 | |
| | 27 | 1. Prusa i3 MK3S+ [3D Printer] - FINKI-B / Lab 1 |
| | 28 | 2. Ultimaker S3 [3D Printer] - FINKI-B / Lab 1 |
| | 29 | 3. Classroom 101 [Classroom] - FINKI-A / 101 |
| | 30 | ... |
| | 31 | 27. Google Cloud Credits [Online Service] - Digital |
| | 32 | |
| | 33 | 1. Filter by Resource Type |
| | 34 | 2. Filter by Building |
| | 35 | 3. View Resource Details |
| | 36 | 4. Check Availability for a Time Slot |
| | 37 | 5. Clear Filters |
| | 38 | 0. Cancel / Go back |
| | 39 | }}} |
| | 40 | |
| | 41 | 2. The user selects ''Filter by Resource Type'' and picks ''Computer Laboratory''. The system queries the available types: |
| | 42 | {{{ |
| | 43 | SELECT DISTINCT rt.type_name FROM resource_types rt ORDER BY rt.type_name; |
| | 44 | }}} |
| | 45 | |
| | 46 | The filtered results are displayed: |
| | 47 | {{{ |
| | 48 | === Browse Resources (4 found) === |
| | 49 | Active filters: Type: Computer Laboratory |
| | 50 | |
| | 51 | 1. Database Lab [Computer Laboratory] - FINKI-B / Lab 4 |
| | 52 | 2. Networking Lab [Computer Laboratory] - FINKI-B / Lab 3 |
| | 53 | 3. Programming Lab 1 [Computer Laboratory] - FINKI-B / Lab 1 |
| | 54 | 4. Programming Lab 2 [Computer Laboratory] - FINKI-B / Lab 2 |
| | 55 | }}} |
| | 56 | |
| | 57 | 3. The user selects ''View Resource Details'' and picks ''Programming Lab 1''. The system queries upcoming reservations for that resource: |
| | 58 | {{{ |
| | 59 | SELECT res.start_time, res.end_time, res.status, res.purpose |
| | 60 | FROM reservations res |
| | 61 | WHERE res.resource_id = 5 |
| | 62 | AND res.status IN ('approved', 'pending') |
| | 63 | AND res.end_time > CURRENT_TIMESTAMP |
| | 64 | ORDER BY res.start_time; |
| | 65 | }}} |
| | 66 | |
| | 67 | The system displays the resource details and upcoming reservations: |
| | 68 | {{{ |
| | 69 | === Programming Lab 1 === |
| | 70 | Type: Computer Laboratory |
| | 71 | Description: Computer lab with 25 workstations, Linux/Windows dual boot |
| | 72 | Location: FINKI-B / Lab 1 |
| | 73 | Available: 08:00 - 22:00 |
| | 74 | Weekends: Yes |
| | 75 | |
| | 76 | Upcoming reservations: |
| | 77 | Start | End | Status | Purpose |
| | 78 | -----------------+-----------------+----------+-------- |
| | 79 | 2026-02-11 14:00 | 2026-02-11 16:00 | approved | Web Development Lab - Week 2 |
| | 80 | 2026-02-18 14:00 | 2026-02-18 16:00 | approved | Web Development Lab - Week 3 |
| | 81 | }}} |
| | 82 | |
| | 83 | 4. The user selects ''Check Availability'' for 2026-02-20 from 14:00 to 16:00. The system checks for conflicts: |
| | 84 | {{{ |
| | 85 | SELECT COUNT(*) FROM reservations |
| | 86 | WHERE resource_id = 5 |
| | 87 | AND status IN ('approved', 'pending') |
| | 88 | AND start_time < '2026-02-20 16:00:00' |
| | 89 | AND end_time > '2026-02-20 14:00:00'; |
| | 90 | }}} |
| | 91 | |
| | 92 | No conflicts found. The system displays the result: |
| | 93 | {{{ |
| | 94 | AVAILABLE: Programming Lab 1 is free on 2026-02-20 from 14:00 to 16:00. |
| | 95 | }}} |