Changes between Initial Version and Version 1 of ImportatntUseCase003


Ignore:
Timestamp:
02/10/25 11:45:34 (12 days ago)
Author:
221128
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImportatntUseCase003

    v1 v1  
     1== EMPLOYEE MANAGES ORDER ==
     2=== Actors ===
     3* Employee
     4=== Steps in the Scenario ===
     5**__1. Employee opens tab.__**
     6
     7SELECT p.name, p.price, oi.quantity
     8FROM order_items oi
     9JOIN products p ON p.id = oi.product_id
     10WHERE oi.order_id = 1;
     11
     12**__2. Employee adds order items.__**
     13
     14INSERT INTO order_items(id, order_id, product_id, is_processed, quantity)
     15VALUES (7,1,1,false,1);
     16INSERT INTO order_items(id ,order_id, product_id, is_processed, quantity)
     17VALUES (8,1,2,false,1);
     18
     19**__3. Employee marks order items as processed.__**
     20
     21UPDATE order_items SET is_processed=true WHERE id=7;
     22UPDATE order_items SET is_processed=true WHERE id=8;
     23
     24**__4. Employee closes tab.__**
     25
     26**__5. System prints bil.__**
     27
     28UPDATE orders SET status='CONFIRMED' WHERE id=1;
     29
     30**__6. Employee finalizes payment.__**
     31
     32INSERT INTO payments(id, order_id, amount, payment_type, tip_amount)
     33SELECT 3,1, SUM(oi.price), ‘cash’, 0 FROM order_items oi WHERE oi.order_id = 1