Changes between Initial Version and Version 1 of UseCase0002PrototypeImplementation


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

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0002PrototypeImplementation

    v1 v1  
     1= Use-case 0002 Implementation - Create reservation request =
     2
     3== Initiating actor ==
     4
     5Room Requester
     6
     7== Other actors ==
     8
     9Reservation Approver
     10
     11== Description of the use-case goals ==
     12
     13The goal of this use-case is to allow a room requester to create a new reservation request. The reservation may include a room, requested equipment, or both. In this prototype demonstration, the requester creates a reservation for a selected room and time interval.
     14
     15The prototype follows the instruction that the user should not be expected to remember database identifiers. Instead of manually entering user_id or room_id, the application lists available users and rooms, and the requester selects the appropriate values from the displayed lists.
     16
     17== Scenario ==
     18
     19The Room Requester chooses the option ''Create reservation request'' from the main menu.
     20The system displays a list of users.
     21The Room Requester selects the requester from the list.
     22The system asks for the reservation date.
     23The Room Requester enters the date.
     24The system asks for the start time and end time.
     25The Room Requester enters the requested time interval.
     26The system asks whether the reservation should include a room.
     27The Room Requester chooses to include a room.
     28The system asks for minimum capacity, room type, and optional required equipment in the room.
     29The system displays available rooms that satisfy the selected criteria.
     30The Room Requester selects one of the available rooms from the list.
     31The system asks whether additional/general equipment should be requested.
     32The Room Requester chooses whether to request additional equipment.
     33The system inserts a new record into the ''project.reservations'' table with status ''pending''.
     34If requested equipment is selected, the system inserts corresponding records into the ''project.reservation_equipment'' table.
     35The system displays the created reservation details.
     36
     37== Screenshots ==
     38
     39The following screenshot shows the selection of the requester and reservation parameters.
     40
     41[[Image(uc0002_choose_user_room.png, width=100%)]]
     42
     43The following screenshot shows the successfully created reservation request.
     44
     45[[Image(uc0002_reservation_created.png, width=100%)]]
     46
     47The following screenshot shows database verification in DBeaver after the reservation was created and later approved.
     48
     49[[Image(dbeaver_reservations_result.png, width=100%)]]
     50
     51== SQL commands used by the system ==
     52
     53The system first reads the list of possible requesters.
     54
     55{{{
     56SELECT
     57user_id,
     58full_name,
     59username,
     60role,
     61email
     62FROM project.users
     63ORDER BY user_id;
     64}}}
     65
     66The system then searches for available rooms for the selected reservation date and time interval.
     67
     68{{{
     69SELECT
     70r.room_id,
     71r.room_code,
     72r.capacity,
     73r.type,
     74b.name AS building_name,
     75b.address
     76FROM project.rooms r
     77JOIN project.buildings b
     78ON b.building_id = r.building_id
     79WHERE r.capacity >= ?
     80AND (? IS NULL OR r.type = ?)
     81AND NOT EXISTS (
     82SELECT 1
     83FROM project.reservations res
     84WHERE res.room_id = r.room_id
     85AND res.reservation_date = ?
     86AND res.status IN ('pending', 'approved')
     87AND ? < res.end_time
     88AND ? > res.start_time
     89)
     90ORDER BY r.capacity, r.room_code;
     91}}}
     92
     93After the requester selects a room, the system inserts the new reservation request.
     94
     95{{{
     96INSERT INTO project.reservations (
     97room_id,
     98user_id,
     99reservation_date,
     100start_time,
     101end_time,
     102status
     103)
     104VALUES (?, ?, ?, ?, ?, 'pending')
     105RETURNING reservation_id;
     106}}}
     107
     108If the requester also selects additional equipment, the system inserts records into ''project.reservation_equipment''.
     109
     110{{{
     111INSERT INTO project.reservation_equipment (
     112reservation_id,
     113equipment_id,
     114requested_quantity
     115)
     116VALUES (?, ?, ?);
     117}}}
     118
     119== Database usage explanation ==
     120
     121This use-case reads data from the following tables:
     122
     123''project.users'' – to allow the requester to be selected from a list.
     124''project.rooms'' – to display available rooms.
     125''project.buildings'' – to display the building name and address.
     126''project.reservations'' – to check room availability and to insert the new reservation.
     127''project.equipment'' – if additional equipment is requested.
     128''project.reservation_equipment'' – if equipment is included in the reservation request.
     129
     130This use-case modifies the database by inserting a new record into ''project.reservations''. The created reservation initially has the status ''pending''.
     131
     132== Result of the implementation ==
     133
     134The prototype successfully creates a new reservation request. In the demonstrated test, the system created reservation ID 9 for requester Nikola Sarafimov, room LAB-1, date 2026-03-01, and time interval 09:00–10:00. The reservation was created with status ''pending'', which means it can later be reviewed by an approver.