Changes between Initial Version and Version 1 of UseCase0003PrototypeImplementation


Ignore:
Timestamp:
03/16/26 21:54:11 (5 days ago)
Author:
221511
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0003PrototypeImplementation

    v1 v1  
     1= UC0003 Prototype Implementation - Approve or Reject Reservations =
     2
     3'''Initiating actor:''' Faculty Administrator
     4
     5'''Other actors:''' Teaching Staff, Student (the requesters)
     6
     7The administrator views a list of all pending reservations, selects one to review in detail (including conflict analysis and recurrence information), and approves or rejects it.
     8
     9== Scenario ==
     10
     11 1. The administrator selects ''Approve or Reject Reservations'' from the main menu. The system queries all pending reservations:
     12{{{
     13SELECT res.reservation_id, res.start_time, res.end_time,
     14       res.purpose, res.created_at, res.recurrence_group_id, res.resource_id,
     15       u.first_name || ' ' || u.last_name AS requested_by,
     16       ut.type_name AS requester_role,
     17       r.name AS resource_name, l.building, l.room
     18FROM reservations res
     19JOIN users u ON res.user_id = u.user_id
     20JOIN user_types ut ON u.type_id = ut.type_id
     21JOIN resources r ON res.resource_id = r.resource_id
     22JOIN resource_types rt ON r.type_id = rt.type_id
     23LEFT JOIN locations l ON r.location_id = l.location_id
     24WHERE res.status = 'pending'
     25ORDER BY res.created_at ASC;
     26}}}
     27
     28The system displays the pending reservations as a numbered list:
     29{{{
     30=== Pending Reservations (4) ===
     31
     32  1. [#4] Database Systems Lecture - Week 4
     33       by Elena Stojanova (Teaching Staff)
     34       Lecture Hall 201 (FINKI-A / 201)
     35       2026-02-24 09:00 - 2026-02-24 11:00
     36  2. [#10] Thesis writing session
     37       by David Angelovski (Student)
     38       ...
     39}}}
     40
     41 2. The administrator selects reservation #4 to review. The system shows full details and detects it is part of a recurring series.
     42{{{
     43SELECT reservation_id, start_time, end_time, status
     44FROM reservations
     45WHERE recurrence_group_id = 'a1b2c3d4-e5f6-4789-abcd-ef0123456789'
     46ORDER BY start_time;
     47}}}
     48
     49 3. The system checks for conflicts with approved reservations on the same resource and time.
     50{{{
     51SELECT res2.reservation_id, res2.start_time, res2.end_time,
     52       res2.purpose
     53FROM reservations res2
     54WHERE res2.resource_id = 3
     55  AND res2.reservation_id != 4
     56  AND res2.status = 'approved'
     57  AND res2.start_time < '2026-02-24 11:00:00'
     58  AND res2.end_time > '2026-02-24 09:00:00';
     59}}}
     60
     61 4. No conflicts found. The administrator approves the reservation. The system updates the status:
     62{{{
     63UPDATE reservations
     64SET status = 'approved', approved_by = 1
     65WHERE reservation_id = 4 AND status = 'pending'
     66RETURNING reservation_id, status;
     67}}}
     68
     69The system confirms the action:
     70{{{
     71  Reservation #4 has been approved.
     72}}}