-- 
 -- Disable foreign key checks
   SET FOREIGN_KEY_CHECKS = 0;
 
  -- Truncate all tables
  TRUNCATE TABLE Service;
  TRUNCATE TABLE Reservation;
  TRUNCATE TABLE Room;
  TRUNCATE TABLE Payment;
  TRUNCATE TABLE Staff;
  TRUNCATE TABLE Customer;
  TRUNCATE TABLE Manager;
  TRUNCATE TABLE Hotel_Building;
 
-- -- Enable foreign key checks
  SET FOREIGN_KEY_CHECKS = 1;

insert into Customer(user_id)
values
	(3),
	(4);

insert into Staff(user_id)
values
	(2);

insert into Manager(user_id)
values
	(1);

insert into Hotel_Building (building_id, address, city, floor, num_rooms)
values 
	('21C', 'Trifun Panovski 11', 'Skopje', 6, 10),
	('3B', 'Maksim Gorki', 'Bitola', 3, 20),
	('14A', 'Borka Talevski', 'Prilep', 5, 15);

insert into Room(room_number, building_id, room_type, number_of_beds, price_per_night, available)
values 
(510, '21C', 'luxury', 2, 120, true),
(202, '21C', 'luxury', 1, 80, false),
(110, '3B', 'regular', 3, 100, true),
(306, '14A', 'regular', 2, 60, false);


insert into Reservation(reservation_id, start_date, end_date, status, reserv_date, room_number, building_id, customer_id, manager_id)
values
(1, '2024-12-15','2024-12-28', 'Approved', '2024-12-03', 202, '21C', 3, 1),
(2, '2025-01-05','2025-01-07', 'Approved', '2025-01-02', 306, '14A', 4, 1);

INSERT INTO Payment (p_id, p_method, amount, p_date, reservation_id, customer_id)
VALUES
    (1, 'card', 80, '2024-12-03', 1, 3), 
    (2, 'cash', 60, '2025-01-02', 2, 4); 

INSERT INTO Service (service_id, service_type, service_date, service_status, room_number, building_id, staff_id)
VALUES 
    (1, 'cleaning', '2025-01-02', 'done', 510, '21C', 2);
