Changes between Initial Version and Version 1 of UseCase0001


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

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0001

    v1 v1  
     1= Use-case 0001 - 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 may also filter rooms by capacity, room type, and required equipment. The system reads data from the rooms, buildings, room_equipment, equipment, and reservations tables. The result is a list of rooms that satisfy the requested conditions and do not already have an active overlapping reservation.
     14
     15'''Scenario:'''
     16
     17The Room Requester enters the desired reservation date, start time, end time, minimum capacity, and room type.
     18The system searches for rooms that satisfy the requested capacity and type.
     19The system checks existing reservations and excludes rooms that already have a pending or approved reservation in an overlapping time interval.
     20The system displays the available rooms to the actor.
     21If the actor also requests specific equipment, the system filters rooms according to the equipment assigned to them.
     22The actor chooses one of the available rooms or changes the search criteria.
     23
     24'''SQL commands used by the system:'''
     25
     26Search available rooms for a selected date, time interval, capacity, and type:
     27
     28{{{
     29SELECT
     30r.room_id,
     31r.room_code,
     32r.capacity,
     33r.type,
     34b.name AS building_name,
     35b.address
     36FROM project.rooms r
     37JOIN project.buildings b
     38ON b.building_id = r.building_id
     39WHERE r.capacity >= 30
     40AND r.type IN ('classroom', 'meeting_room')
     41AND NOT EXISTS (
     42SELECT 1
     43FROM project.reservations res
     44WHERE res.room_id = r.room_id
     45AND res.reservation_date = DATE '2026-02-15'
     46AND res.status IN ('pending', 'approved')
     47AND TIME '10:00' < res.end_time
     48AND TIME '12:00' > res.start_time
     49)
     50ORDER BY r.capacity, r.room_code;
     51}}}
     52
     53Search available rooms that also contain a specific equipment type:
     54
     55{{{
     56SELECT
     57r.room_id,
     58r.room_code,
     59r.capacity,
     60r.type,
     61b.name AS building_name,
     62e.name AS equipment_name,
     63re.quantity
     64FROM project.rooms r
     65JOIN project.buildings b
     66ON b.building_id = r.building_id
     67JOIN project.room_equipment re
     68ON re.room_id = r.room_id
     69JOIN project.equipment e
     70ON e.equipment_id = re.equipment_id
     71WHERE r.capacity >= 20
     72AND e.name = 'Projector'
     73AND NOT EXISTS (
     74SELECT 1
     75FROM project.reservations res
     76WHERE res.room_id = r.room_id
     77AND res.reservation_date = DATE '2026-02-15'
     78AND res.status IN ('pending', 'approved')
     79AND TIME '10:00' < res.end_time
     80AND TIME '12:00' > res.start_time
     81)
     82ORDER BY r.room_code;
     83}}}