Changes between Version 1 and Version 2 of UseCase14


Ignore:
Timestamp:
05/17/26 20:01:01 (8 days ago)
Author:
181201
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase14

    v1 v2  
    1 == Use-case 0014 - Cancel a Pending Booking
     1== Use-case 0014 - Cancel an Active Booking
    22
    33'''Initiating actor:''' Pet Owner
     
    66
    77'''Description:'''
    8 An owner decides they no longer need a sitter and cancels a pending booking request before the sitter accepts it or before payment is made.
     8An owner decides they no longer need a sitter and cancels an active (Pending or Confirmed) booking request before the job takes place.
    99
    1010'''Scenario:'''
    1111 1. Pet Owner navigates to their "My Bookings" page.
    12  2. System fetches the owner's current pending bookings:
     12 2. System fetches the owner's current active bookings:
    1313{{{
    1414#!sql
     
    1616FROM bookings
    1717WHERE owner_id = (SELECT user_id FROM users WHERE username = 'owner_bojan')
    18   AND status = 'PENDING';
     18  AND status IN ('Pending', 'Confirmed');
    1919}}}
    20  3. Owner clicks the "Cancel Request" button.
     20 3. Owner clicks the "Cancel Booking" button.
    2121 4. System updates the booking status:
    2222{{{
    2323#!sql
    2424UPDATE bookings
    25 SET status = 'CANCELLED'
    26 WHERE booking_id = (
    27     SELECT booking_id FROM bookings
    28     WHERE status = 'PENDING'
    29       AND owner_id = (SELECT user_id FROM users WHERE username = 'owner_bojan')
    30     LIMIT 1
    31 );
     25SET status = 'Canceled'
     26WHERE booking_id = 'specific-booking-uuid-here';
    3227}}}