Changes between Version 1 and Version 2 of ImportatntUseCase003
- Timestamp:
- 02/10/25 11:55:59 (12 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ImportatntUseCase003
v1 v2 4 4 === Steps in the Scenario === 5 5 **__1. Employee opens tab.__** 6 6 {{{ 7 7 SELECT p.name, p.price, oi.quantity 8 8 FROM order_items oi 9 9 JOIN products p ON p.id = oi.product_id 10 WHERE oi.order_id = 1; 10 WHERE oi.order_id = 1 11 }}} 11 12 12 13 **__2. Employee adds order items.__** 13 14 {{{ 14 15 INSERT INTO order_items(id, order_id, product_id, is_processed, quantity) 15 16 VALUES (7,1,1,false,1); 16 17 INSERT INTO order_items(id ,order_id, product_id, is_processed, quantity) 17 18 VALUES (8,1,2,false,1); 18 19 }}} 19 20 **__3. Employee marks order items as processed.__** 20 21 {{{ 21 22 UPDATE order_items SET is_processed=true WHERE id=7; 22 23 UPDATE order_items SET is_processed=true WHERE id=8; 23 24 }}} 24 25 **__4. Employee closes tab.__** 25 26 26 27 **__5. System prints bil.__** 27 28 UPDATE orders SET status='CONFIRMED' WHERE id=1; 28 {{{ 29 UPDATE orders SET status='CONFIRMED' WHERE id=1 30 }}} 29 31 30 32 **__6. Employee finalizes payment.__** 31 33 {{{ 32 34 INSERT INTO payments(id, order_id, amount, payment_type, tip_amount) 33 35 SELECT 3,1, SUM(oi.price), ‘cash’, 0 FROM order_items oi WHERE oi.order_id = 1 36 }}}