Changes between Initial Version and Version 1 of UseCase0001PrototypeImplementation


Ignore:
Timestamp:
06/18/26 23:52:12 (2 days ago)
Author:
223091
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0001PrototypeImplementation

    v1 v1  
     1= Use-case 0001 Implementation - Search available rooms =
     2
     3== Initiating actor ==
     4
     5Room Requester
     6
     7== Other actors ==
     8
     9None
     10
     11== Description of the use-case goals ==
     12
     13The goal of this use-case is to allow a room requester to search for rooms that are available for a selected date and time interval. The requester can enter the reservation date, start time, end time, minimum capacity, room type, and optionally required equipment. The system reads data from the database and displays only rooms that satisfy the selected criteria and do not already have an active overlapping reservation.
     14
     15This implementation demonstrates that the prototype can read from the database, join multiple related tables, apply filtering conditions, and return meaningful results to the user.
     16
     17== Scenario ==
     18
     191. The Room Requester chooses the option ''Search available rooms'' from the main menu.
     202. The system asks for the reservation date.
     213. The Room Requester enters the date in the format YYYY-MM-DD.
     224. The system asks for the start time and end time.
     235. The Room Requester enters the time interval in the format HH:MM.
     246. The system asks for the minimum required room capacity.
     257. The Room Requester enters the minimum capacity.
     268. The system asks for an optional room type filter.
     279. The Room Requester either enters a room type such as classroom, meeting_room, lab, or office, or leaves the field empty.
     2810. The system asks for optional required equipment.
     2911. The Room Requester either enters an equipment name or leaves the field empty.
     3012. The system executes SQL queries against the database.
     3113. The system displays all available rooms that satisfy the entered criteria.
     32
     33== Screenshot ==
     34
     35The following screenshot shows the execution of this use-case in the prototype application.
     36
     37[[Image(uc0001_search_available_rooms.png, width=100%)]]
     38
     39== SQL commands used by the system ==
     40
     41The system searches for rooms that satisfy the selected date, time interval, capacity, and optional room type. It excludes rooms that already have an active overlapping reservation.
     42
     43{{{
     44SELECT
     45r.room_id,
     46r.room_code,
     47r.capacity,
     48r.type,
     49b.name AS building_name,
     50b.address
     51FROM project.rooms r
     52JOIN project.buildings b
     53ON b.building_id = r.building_id
     54WHERE r.capacity >= ?
     55AND (? IS NULL OR r.type = ?)
     56AND NOT EXISTS (
     57SELECT 1
     58FROM project.reservations res
     59WHERE res.room_id = r.room_id
     60AND res.reservation_date = ?
     61AND res.status IN ('pending', 'approved')
     62AND ? < res.end_time
     63AND ? > res.start_time
     64)
     65ORDER BY r.capacity, r.room_code;
     66}}}
     67
     68If the requester enters a required equipment name, the system additionally checks whether the room contains the requested equipment.
     69
     70{{{
     71SELECT
     72r.room_id,
     73r.room_code,
     74r.capacity,
     75r.type,
     76b.name AS building_name,
     77b.address,
     78e.name AS equipment_name,
     79re.quantity
     80FROM project.rooms r
     81JOIN project.buildings b
     82ON b.building_id = r.building_id
     83JOIN project.room_equipment re
     84ON re.room_id = r.room_id
     85JOIN project.equipment e
     86ON e.equipment_id = re.equipment_id
     87WHERE r.capacity >= ?
     88AND (? IS NULL OR r.type = ?)
     89AND e.name = ?
     90AND NOT EXISTS (
     91SELECT 1
     92FROM project.reservations res
     93WHERE res.room_id = r.room_id
     94AND res.reservation_date = ?
     95AND res.status IN ('pending', 'approved')
     96AND ? < res.end_time
     97AND ? > res.start_time
     98)
     99ORDER BY r.capacity, r.room_code;
     100}}}
     101
     102== Database usage explanation ==
     103
     104This use-case reads data from the following tables:
     105
     106* ''project.rooms'' – contains information about rooms, capacity, and room type.
     107* ''project.buildings'' – contains the building name and address of each room.
     108* ''project.room_equipment'' – used when the requester searches for a room with specific equipment.
     109* ''project.equipment'' – contains equipment names.
     110* ''project.reservations'' – used to check whether a room is already reserved for the selected date and time interval.
     111
     112No data is modified in this use-case. The use-case only reads data and displays the available rooms to the user.
     113
     114== Result of the implementation ==
     115
     116The prototype successfully displays available rooms for the selected date and time interval. The user does not need to know any internal database identifiers. The system returns room codes, room types, capacities, building names, and addresses, which are understandable for the end user.