{{{#!sql
-- PRODUCT
INSERT INTO product (product_code, price, availability, weight, width_x_length_x_depth, aprox_production_time, description, delivery_cost) VALUES
(00100001, 700, 50, 2.5, '30x20x10', 10, 'Handmade wooden chair with oak wood', 50),
(00200001, 150, 10, 0.2, '20x20x15', 2, 'Heart crochet', 0),
(00200002, 199, 100, 0.75, '40x40x1', 14, 'Decorative wall hanging made with beads', 0);

-- IMAGE
INSERT INTO image (product_code, image) VALUES
(00100001, 'chair.jpg'),
(00200001, 'crochet-heart-red.jpg'),
(00200001, 'crochet-heart-blue.jpg'),
(00200002, 'wall_hanging.jpg');


-- COLOR
INSERT INTO color (product_code, color) VALUES
(00100001, 'Brown'),
(00200001, 'Blue'),
(00200001, 'Red'),
(00200001, 'Yellow'),
(00200001, 'Green'),
(00200002, 'White and Pink'),
(00200002, 'Black and Gold'),
(00200002, 'Orange, Green and Purpule);


-- STORE
INSERT INTO store (store_id, name, date_of_founding, physical_address, store_email, rating) VALUES
(001, 'WoodCraft Skopje', '2015-03-12', 'st.Ilindenska 45, Skopje 1000, Macedonia', 'contact@woodcraft.mk', 4.6),
(002, 'Fox Crochets', '2023-06-01', 'st.Kej Makedonija 12, Ohrid 6000, Macedonia', 'ohrid@woodcraft.mk', 4.8);


-- PERSONAL
INSERT INTO personal (ssn, first_name, last_name, email, password) VALUES    
('1234567890123', 'Marko', 'Petrovski', 'marko@woodcraft.mk', 'Havr6njs09$hdgs'),
('9876543210987', 'Antonio', 'Trajkovski', 'antonio@woodcraft.mk', 'GKm78BHs&vJHA'),
('4567891234567', 'Sara', 'Vaneva', 's.vaneva@foxcrochets.mk', 'hY69Btvhs90');


-- PERMISSIONS
INSERT INTO permissions (personal_SSN, type, authorisation) VALUES
('1234567890123', 'BOSS', 'admin'),
('9876543210987', 'EMPLOYEE', 'M.Petrovski'),
('4567891234567', 'BOSS', 'admin');


-- BOSS
INSERT INTO boss (boss_SSN) VALUES
('1234567890123'),
('4567891234567');


-- EMPLOYEES
INSERT INTO employees (employee_SSN, date_of_hire) VALUES
('9876543210987', '2019-09-01');


-- CLIENT
INSERT INTO client (client_ID, first_name, last_name, email, password) VALUES
(1, 'Ivan', 'Stojanov', 'ivan@gmail.com', 'hkh689gvgsh%hd'),     -- hash value of the passwords
(2, 'Marija', 'Kostova', 'marija@yahoo.com', 'PJdbbh334$djk-hs'),    -- hash value of the passwords
(3, 'Antoneta', 'Mariovska', 'mariovskaantoneta@finki.ukim.mk', '*bxhc6cbsd3@xh');   -- hash value of the password


-- DELIVERY_ADDRESS
INSERT INTO delivery_address (client_ID, address) VALUES
(1, 'st.Partizanska 10, Skopje 1000, Macedonia'),
(2, 'st.Turisticka 5, Bitola 7000, Macedonia'),
(3, 'st.32 4, s.Cucer-Sandevo, Skopje, Macedonia');


-- ORDER
INSERT INTO "order" (order_num, client_ID, status, last_date_mod, payment_method, discount) VALUES
(0022025000001, 1, 'placed order', '2025-12-01 10:15:00', 'credit card ****6750', 0.0),
(0022025000002, 1, 'packaging', '2025-12-10 18:00:00', 'PayPal account *******', 0.0),
(0012025000001, 2, 'delivered', '2025-12-02 14:30:00', 'cash', 4.0);


-- REPORT
INSERT INTO report (date, store_ID, overall_profit, sales_trend, marketing_growth, owner_signature) VALUES
('2024-11-30 23:59:59', 001, 125000.00, 'Increasing', 'Stable growth', 'M.Petrovski'),
('2024-11-30 23:59:59', 002, 98000.00, 'Stable', 'Moderate growth', 'S.Vaneva');


-- MONTHLY_PROFIT
INSERT INTO monthly_profit (report_date, store_ID, month_and_year, profit) VALUES
('2024-11-30 23:59:59', 001, '2024-11-01', 12500.00),
('2024-11-30 23:59:59', 002, '2024-11-01', 8000.00);


-- REQUEST
INSERT INTO request (request_num, date_and_time, problem, notes_of_communication, costumer_satisfaction) VALUES
(001112025001, '2024-11-03 11:20:00', 'Late delivery', 'Apologized and offered discount', 4.0),
(002122025001, '2024-12-04 09:10:00', 'Military discount', 'Discount approved', 5.0);


-- MAKES_REQUEST
INSERT INTO makes_request (client_ID, request_num) VALUES
(3, '002122025001'),
(2, '001112025001');


-- ANSWERS
INSERT INTO answers (request_num, personal_SSN) VALUES
('001112025001', '4567891234567'),
('002122025001', '1234567890123');

-- FOR_STORE
INSERT INTO for_store (request_num, store_ID) VALUES
('002122025001', 002),
('001112025001', 001);

-- REVIEW
INSERT INTO review (order_num, comment, rating, last_mod_date) VALUES
('0012025000001', 'Great quality, slightly late delivery', 4.0, '2024-12-05 18:00:00');


-- CHANGE
INSERT INTO change (date_and_time, product_code, changes) VALUES
('2024-11-10 09:00:00', 00100001, 'FROM aprox_production_time=14 TO aprox_production_time=10'),
('2024-11-12 15:30:00', 00200001, 'Added new color');


-- WORKS_IN_STORE
INSERT INTO works_in_store (personal_SSN, store_ID) VALUES
('1234567890123', 001),
('9876543210987', 001),
('4567891234567', 002);


-- WORKED
INSERT INTO worked (personal_SSN, report_date, store_ID, wage, pay_method, total_hours, week) VALUES
('1234567890123', '2025-11-30 23:59:59', 001, 75, 'hourly', 48, '2025-11-24 - 2025-11-30'),
('9876543210987', '2025-11-30 23:59:59', 001, 75, 'hourly', 38, '2025-11-24 - 2025-11-30'),
('4567891234567', '2025-11-30 23:59:59', 002, 450, 'weekly', 52, '2025-11-24 - 2025-11-30');


-- SELLS
INSERT INTO sells (product_code, store_ID, discount) VALUES
(00100001, 001, 0.0),
(00200001, 002, 0.0),
(00200002, 002, 0.5);


-- INCLUDES
INSERT INTO includes (order_num, product_code) VALUES
('0012025000001', '00100001'),
('0022025000001', '00200002'),
('0022025000002', '00200001');


-- APPROVES
INSERT INTO approves (boss_SSN, report_date, store_ID, owner_signature) VALUES
('1234567890123', '2025-12-01 09:56:30', 001, 'M.Petrovski'),
('4567891234567', '2025-12-03 13:06:12', 002, 'S.Vaneva');


-- EXCHANGES_DATE
INSERT INTO exchanges_date (report_date, store_ID, monthly_profit, date, sales, damages) VALUES
('2024-11-30 23:59:59', 001, 38750.00, '2024-12-01 08:00:00', 52, 750),
('2024-11-30 23:59:59', 002, 26150, '2024-12-01 08:00:00', 40, NULL);
}}};