| | 1 | == Product Update |
| | 2 | |
| | 3 | === Actors: **Registered Employee/Boss** |
| | 4 | |
| | 5 | **1.** A member of the personal opens a product from their store. |
| | 6 | |
| | 7 | **2.** The system checks if the member has permission to change products. |
| | 8 | |
| | 9 | **3.** After permission is confiremed, the registered user clicks "Edit product". |
| | 10 | |
| | 11 | **4.** The employee/boss makes changes. |
| | 12 | |
| | 13 | **5.** Application updates the data in {{{product}}}. |
| | 14 | |
| | 15 | {{{#!sql |
| | 16 | UPDATE product |
| | 17 | SET price = 44.99, |
| | 18 | availability = 15, |
| | 19 | description = 'Updated handmade wooden box' |
| | 20 | WHERE code = '00100001'; |
| | 21 | |
| | 22 | }}} |
| | 23 | |
| | 24 | **6.** If new pictures of the product, the data in {{{image}}} is updated accordingly. |
| | 25 | |
| | 26 | {{{#!sql |
| | 27 | INSERT INTO image(product_code, image) VALUES |
| | 28 | ('00100001', 'black-box-open.png'); |
| | 29 | |
| | 30 | }}} |
| | 31 | |
| | 32 | |
| | 33 | {{{#!sql |
| | 34 | DELETE FROM image |
| | 35 | WHERE product_code='00100001' AND image='black-box-side.png'; |
| | 36 | |
| | 37 | }}} |
| | 38 | |
| | 39 | **7.** If the colors in which the product is available changes, {{{color}}} is updated accordingly. |
| | 40 | |
| | 41 | {{{#!sql |
| | 42 | INSERT INTO color(product_code, color) VALUES |
| | 43 | ('00100001','Blue and White'); |
| | 44 | |
| | 45 | }}} |
| | 46 | |
| | 47 | {{{#!sql |
| | 48 | DELETE FROM color |
| | 49 | WHERE product_code='00100001' AND color='Black'; |
| | 50 | |
| | 51 | }}} |
| | 52 | |
| | 53 | **8.** The change is logged in {{{change}}}. |
| | 54 | |
| | 55 | {{{#!sql |
| | 56 | INSERT INTO change(date_and_time, product_code, changes) VALUES |
| | 57 | ('2025-12-30 15:40:35', '00100001', 'Changed color "Black" to "Blue and White"'); |
| | 58 | |
| | 59 | }}} |
| | 60 | |
| | 61 | **9.** The employee who made the change is logged in {{{makes_change}}}. |
| | 62 | |
| | 63 | {{{#!sql |
| | 64 | INSER INTO makes_change(personal_ID, change_date_time, product_code) VALUES |
| | 65 | ('0010002', '2025-12-30 15:40:35', '00100001'); |
| | 66 | |
| | 67 | }}} |
| | 68 | |