== Product Creation ==== Actors: **Registered Boss / Employee** **1.** System checks if the authenticated user has permission to create a product for the store where they are registered. {{{#!sql SELECT CASE WHEN EXISTS ( SELECT 1 FROM permissions WHERE personal_ID='0010002' AND (permission_type='BOSS' OR permission_type='MANAGER') ) THEN 'Yes' ELSE 'No' END AS has_permission; }}} **2.** The registered user selects “Create Product”. **3.** Product information is entered. **4.** The application inserts the product into {{{product}}}. {{{#!sql INSERT INTO product (code, price, availability, weight, width_x_length_x_depth, aprox_production_time, description, category_id, store_id) VALUES ('00100001', 49.99, 20, 1.20, '20x15x10', 7, 'Handmade wooden box', 1, '001'); }}} **5.** The colors in which the product is availabe are inseted into {{{color}}}. {{{#!sql INSERT INTO color (product_code, color) VALUES ('00100001', 'Red'), ('00100001', 'Black'); }}} **6.** The images with the product are inserted into {{{image}}}. {{{#!sql INSERT INTO image (product_code, image) VALUES ('00100001', 'Wooden-box-red_front.png'), ('00100001', 'Wooden-box-red_side.png'), ('00100001', 'Wooden-box-black_side.png'); }}} **7.** Product is shown publicly with the other products.