| | 1 | == Refund Proccessing |
| | 2 | |
| | 3 | === Actors: **Registered Shopper / Boss/ Employee** |
| | 4 | |
| | 5 | **1.** The client requests a refund. |
| | 6 | |
| | 7 | **2.** The refund is recorded in {{{refund}}}. |
| | 8 | {{{#!sql |
| | 9 | INSERT INTO refund (refund_id, order_num, amount, reason, status) |
| | 10 | VALUES ('001202500001', '00125100001', 149.00, 'Damaged product', 'requested'); |
| | 11 | |
| | 12 | }}} |
| | 13 | |
| | 14 | **3.** The boss or an employee take over the refund and the refund status updates. |
| | 15 | |
| | 16 | {{{#!sql |
| | 17 | UPDATE refund |
| | 18 | SET status = 'processing' |
| | 19 | WHERE order_num = '00125100001'; |
| | 20 | |
| | 21 | }}} |
| | 22 | |
| | 23 | **4.** The boss or an employee with the specific permission reviews and approves or declines it accordingly. |
| | 24 | |
| | 25 | **5.** The refund status is updated. |
| | 26 | |
| | 27 | {{{#!sql |
| | 28 | UPDATE refund |
| | 29 | SET status = 'approved' |
| | 30 | WHERE order_num = '00125100001'; |
| | 31 | |
| | 32 | }}} |