Changes between Version 1 and Version 2 of UseCase06


Ignore:
Timestamp:
05/17/26 19:11:34 (8 days ago)
Author:
181201
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase06

    v1 v2  
    1 == Use-case 0006 - Process a Payment
     1== Use-case 0006 - Process an Upfront Payment
    22
    33'''Initiating actor:''' Pet Owner
     
    66
    77'''Description:'''
    8 The owner must pay for a confirmed booking. The system finds unpaid bookings for that user, and the owner submits their payment method. The system records the financial transaction and links it securely to the booking.
     8The owner must provide payment details when submitting a new booking request. The system records the financial transaction upfront and links it securely to the pending booking.
    99
    1010'''Scenario:'''
    11  1. Pet Owner navigates to their "Pending Payments" dashboard.
    12  2. System fetches confirmed bookings that do not have a matching payment record yet using a LEFT JOIN:
    13 {{{
    14 #!sql
    15 SELECT b.booking_id, b.address, b.date_from
    16 FROM bookings b
    17 LEFT JOIN payments p ON b.booking_id = p.booking_id
    18 WHERE b.owner_id = (SELECT user_id FROM users WHERE username = 'owner_bojan')
    19   AND b.status = 'CONFIRMED'
    20   AND p.payment_id IS NULL;
    21 }}}
    22  3. Owner selects a booking, chooses 'CREDIT_CARD', and submits the payment.
    23  4. System securely records the payment in the database, satisfying the 1:1 relationship rule:
     11 1. Pet Owner navigates to a Sitter's profile and clicks "Book Now".
     12 2. Owner fills out the booking dates, address, and selects their pets.
     13 3. Owner enters the payment amount, chooses 'Card' from the dropdown, and submits the form.
     14 4. System securely creates the booking, and immediately records the payment in the database, satisfying the 1:1 relationship rule:
    2415{{{
    2516#!sql
     
    2718VALUES (
    2819    1500,
    29     'CREDIT_CARD',
     20    'Card',
    3021    (SELECT booking_id FROM bookings WHERE address = 'ul. Partizanska br. 10' LIMIT 1)
    3122);