| 1 | INSERT INTO users(id, email, password, phone_number, street, city) -- password1
|
|---|
| 2 | VALUES
|
|---|
| 3 | (1, 'test@hotmail.com', '$2a$10$rliIgXfgZgT1ljzxf.3NjeF1hx63s30xKfUsKjeUYA8jL/GXA1Jsy', '070003005', 'Mladinska 3', 'Strumica'),
|
|---|
| 4 | (2, 'test2@hotmail.com', '$2a$10$rliIgXfgZgT1ljzxf.3NjeF1hx63s30xKfUsKjeUYA8jL/GXA1Jsy', '070001002', 'Marsal Tito 10', 'Strumica'),
|
|---|
| 5 | (3, 'test3@hotmail.com', '$2a$10$rliIgXfgZgT1ljzxf.3NjeF1hx63s30xKfUsKjeUYA8jL/GXA1Jsy', '070003003', 'Mladinska 5', 'Strumica'),
|
|---|
| 6 | (4, 'test4@hotmail.com', '$2a$10$rliIgXfgZgT1ljzxf.3NjeF1hx63s30xKfUsKjeUYA8jL/GXA1Jsy', '070004004', 'Marsal Tito 11', 'Strumica'),
|
|---|
| 7 | (5, 'test5@hotmail.com', '$2a$10$rliIgXfgZgT1ljzxf.3NjeF1hx63s30xKfUsKjeUYA8jL/GXA1Jsy', '070005005', 'Mladinska 12', 'Strumica');
|
|---|
| 8 |
|
|---|
| 9 | INSERT INTO employees(user_id, net_salary, gross_salary)
|
|---|
| 10 | VALUES
|
|---|
| 11 | (1, 30000, 40000),
|
|---|
| 12 | (3, 50000, 62000),
|
|---|
| 13 | (4, 35000, 46000),
|
|---|
| 14 | (5, 28000, 37000);
|
|---|
| 15 |
|
|---|
| 16 | INSERT INTO managers(employee_id)
|
|---|
| 17 | VALUES
|
|---|
| 18 | (3);
|
|---|
| 19 |
|
|---|
| 20 | INSERT INTO staff_roles(id, name)
|
|---|
| 21 | VALUES
|
|---|
| 22 | (1, 'Server'),
|
|---|
| 23 | (2, 'Chef'),
|
|---|
| 24 | (3, 'Bartender'),
|
|---|
| 25 | (4, 'Hostess');
|
|---|
| 26 |
|
|---|
| 27 | INSERT INTO front_staff(employee_id, tip_percent, staff_role_id)
|
|---|
| 28 | VALUES
|
|---|
| 29 | (1, .4, 1),
|
|---|
| 30 | (5, 0.1, 4);
|
|---|
| 31 |
|
|---|
| 32 | INSERT INTO back_staff(employee_id, staff_role_id)
|
|---|
| 33 | VALUES
|
|---|
| 34 | (4, 2);
|
|---|
| 35 |
|
|---|
| 36 | INSERT INTO customers(user_id)
|
|---|
| 37 | VALUES
|
|---|
| 38 | (2);
|
|---|
| 39 |
|
|---|
| 40 | INSERT INTO shifts (id, date, start_time, end_time, manager_id)
|
|---|
| 41 | VALUES
|
|---|
| 42 | (1, current_date, '09:00:00', '17:00:00', 3);
|
|---|
| 43 |
|
|---|
| 44 | INSERT INTO assignments(id, clock_in_time, clock_out_time, manager_id, employee_id, shift_id)
|
|---|
| 45 | VALUES
|
|---|
| 46 | (1, NULL, NULL, 3, 1, 1);
|
|---|
| 47 |
|
|---|
| 48 | INSERT INTO tables(table_number, seat_capacity)
|
|---|
| 49 | VALUES
|
|---|
| 50 | (1, 4),
|
|---|
| 51 | (2, 8);
|
|---|
| 52 |
|
|---|
| 53 | INSERT INTO reservations(id, user_id, creation_timestamp, datetime, stay_length, number_of_people)
|
|---|
| 54 | VALUES
|
|---|
| 55 | (1, 2, now(), now(), NULL, 4);
|
|---|
| 56 |
|
|---|
| 57 | INSERT INTO frontstaff_managed_reservations(id, reservation_id, front_staff_id, table_number)
|
|---|
| 58 | VALUES
|
|---|
| 59 | (1, 1, 5, 1);
|
|---|
| 60 |
|
|---|
| 61 | INSERT INTO categories(id, name)
|
|---|
| 62 | VALUES
|
|---|
| 63 | (1, 'Drinks'),
|
|---|
| 64 | (2, 'Appetizers'),
|
|---|
| 65 | (3, 'Entrees');
|
|---|
| 66 |
|
|---|
| 67 | INSERT INTO products(id, name, description, price, category_id, manage_inventory, tax_class)
|
|---|
| 68 | VALUES
|
|---|
| 69 | (1, 'Coca Cola', 'A classic carbonated soft drink.', 100, 1, TRUE, 'A'),
|
|---|
| 70 | (2, 'Pomfrit so sirenje', 'Crispy french fries topped with melted cheese.', 250, 2, FALSE, 'A');
|
|---|
| 71 |
|
|---|
| 72 | INSERT INTO inventories(product_id, quantity)
|
|---|
| 73 | VALUES
|
|---|
| 74 | (1, 100);
|
|---|
| 75 |
|
|---|
| 76 | -- The 'employee_id' in orders table is now used to link orders to front staff.
|
|---|
| 77 | INSERT INTO orders(id, status, datetime, employee_id)
|
|---|
| 78 | VALUES
|
|---|
| 79 | (1, 'PENDING', '2025-01-05 10:00:00', 1), -- Order placed by server with employee_id 1
|
|---|
| 80 | (2, 'ACCEPTED', '2025-01-05 10:00:00', 1),
|
|---|
| 81 | (3, 'CONFIRMED', '2025-01-05 11:00:00', NULL); -- Online order with no employee assigned initially
|
|---|
| 82 |
|
|---|
| 83 | INSERT INTO order_items (id, order_id, product_id, is_processed, quantity, price)
|
|---|
| 84 | SELECT 1, 1, 1, TRUE, 3, price FROM products WHERE id = 1
|
|---|
| 85 | UNION ALL
|
|---|
| 86 | SELECT 2, 1, 2, FALSE, 1, price FROM products WHERE id = 2
|
|---|
| 87 | UNION ALL
|
|---|
| 88 | SELECT 3, 3, 2, FALSE, 2, price FROM products WHERE id = 2
|
|---|
| 89 | UNION ALL
|
|---|
| 90 | SELECT 4, 3, 1, FALSE, 2, price FROM products WHERE id = 1;
|
|---|
| 91 |
|
|---|
| 92 | INSERT INTO tab_orders(order_id, table_number)
|
|---|
| 93 | VALUES
|
|---|
| 94 | (1, 1);
|
|---|
| 95 |
|
|---|
| 96 | INSERT INTO online_orders(order_id, delivery_address, customer_id)
|
|---|
| 97 | VALUES
|
|---|
| 98 | (3, 'Leninova 5', 2);
|
|---|
| 99 |
|
|---|
| 100 | INSERT INTO payments(id, order_id, amount, payment_type, tip_amount)
|
|---|
| 101 | VALUES
|
|---|
| 102 | (1, 3, 700, 'cash', 10); |
|---|