= UC0001 Prototype Implementation - Browse Available Resources = '''Initiating actor:''' Student (also available to Teaching Staff and Administrator) '''Other actors:''' None 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. == Scenario == 1. The user selects ''Browse Available Resources'' from the main menu. The system runs the following query: {{{ SELECT r.resource_id, r.name, r.description, r.available_from, r.available_to, r.available_weekends, rt.type_name, rt.is_physical, l.building, l.room FROM resources r JOIN resource_types rt ON r.type_id = rt.type_id LEFT JOIN locations l ON r.location_id = l.location_id ORDER BY rt.type_name, r.name; }}} The system displays all resources as a numbered list with a sub-menu: {{{ === Browse Resources (27 found) === 1. Prusa i3 MK3S+ [3D Printer] - FINKI-B / Lab 1 2. Ultimaker S3 [3D Printer] - FINKI-B / Lab 1 3. Classroom 101 [Classroom] - FINKI-A / 101 ... 27. Google Cloud Credits [Online Service] - Digital 1. Filter by Resource Type 2. Filter by Building 3. View Resource Details 4. Check Availability for a Time Slot 5. Clear Filters 0. Cancel / Go back }}} 2. The user selects ''Filter by Resource Type'' and picks ''Computer Laboratory''. The system queries the available types: {{{ SELECT DISTINCT rt.type_name FROM resource_types rt ORDER BY rt.type_name; }}} The filtered results are displayed: {{{ === Browse Resources (4 found) === Active filters: Type: Computer Laboratory 1. Database Lab [Computer Laboratory] - FINKI-B / Lab 4 2. Networking Lab [Computer Laboratory] - FINKI-B / Lab 3 3. Programming Lab 1 [Computer Laboratory] - FINKI-B / Lab 1 4. Programming Lab 2 [Computer Laboratory] - FINKI-B / Lab 2 }}} 3. The user selects ''View Resource Details'' and picks ''Programming Lab 1''. The system queries upcoming reservations for that resource: {{{ SELECT res.start_time, res.end_time, res.status, res.purpose FROM reservations res WHERE res.resource_id = 5 AND res.status IN ('approved', 'pending') AND res.end_time > CURRENT_TIMESTAMP ORDER BY res.start_time; }}} The system displays the resource details and upcoming reservations: {{{ === Programming Lab 1 === Type: Computer Laboratory Description: Computer lab with 25 workstations, Linux/Windows dual boot Location: FINKI-B / Lab 1 Available: 08:00 - 22:00 Weekends: Yes Upcoming reservations: Start | End | Status | Purpose -----------------+-----------------+----------+-------- 2026-02-11 14:00 | 2026-02-11 16:00 | approved | Web Development Lab - Week 2 2026-02-18 14:00 | 2026-02-18 16:00 | approved | Web Development Lab - Week 3 }}} 4. The user selects ''Check Availability'' for 2026-02-20 from 14:00 to 16:00. The system checks for conflicts: {{{ SELECT COUNT(*) FROM reservations WHERE resource_id = 5 AND status IN ('approved', 'pending') AND start_time < '2026-02-20 16:00:00' AND end_time > '2026-02-20 14:00:00'; }}} No conflicts found. The system displays the result: {{{ AVAILABLE: Programming Lab 1 is free on 2026-02-20 from 14:00 to 16:00. }}}