DELETE FROM  Objekt;
DELETE FROM  Vo_Izgradba;
DELETE FROM  Gotov;
DELETE FROM  Nadzor;
DELETE FROM  Podizveduvac;
DELETE FROM  Rabotnik;
DELETE FROM  Dobavuvac;
DELETE FROM  Nabavka;
DELETE FROM  Korisnik;
DELETE FROM  Sopstvenik;
DELETE FROM  Raboti_Na;
DELETE FROM  Raboti_Za;
DELETE FROM  Nadgleduva;
DELETE FROM  Pobaruva;
DELETE FROM  Nameneta_Za;
DELETE FROM  Odobruva;
DELETE FROM  Oddrzuva;
DELETE FROM  Ispolnuva;


-- Insert data into Korisnik
INSERT INTO Korisnik (UID, Username, Password, Privilegii) VALUES
(1, 'admin', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
(2, 'upravitel', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
(3, 'mile', 'Poncho6-Geologist6-Dropkick6-Haiku8-Blabber4', 1),
(4, 'sasha', 'passwordabc', 1),
(5, 'vlatko', '19781212vlatkovlatko', 1),
(6, 'magi', 'hudawlsd8987897', 1),
(7, 'akvaterm', 'passworq-pwefh-awddef', 2),
(8, 'betaelektrik', 'cnqe0w9uhcvaosudhjbcvoq', 2),
(9, 'dzidarprom', '0q823794tygrhfbaku', 2),
(10, 'fasadaplus', '123123pasvord', 2),
(11, 'primakrov', 'passworddef', 2),
(12, 'dvornikenz', 'asdasdasd123123', 2),
(13, 'rolokraft', '131313kuchemache', 2),
(14, 'megaenterier', 'testtest123123', 2),
(15, 'fullconstruct', 'bsjFvS235Fhk', 2);

-- Insert data into Sopstvenik
INSERT INTO Sopstvenik (UID) VALUES
(1);

-- Insert data into Nadzor
INSERT INTO Nadzor (Nadzor_Ime, Plata, Kvalifikacii, Firma, UID) VALUES
('Mile Kolevski', 50000, 'Civil Engineer', 'Domashen', 2),
('Sasha Ketic', 60000, 'Structural Engineer', 'ArchiCore', 3),
('Vlatko Senkov', 55000, 'Project Manager', 'BuildCorp', 4),
('Magdalena Filipova', 58000, 'Architect', 'DesignWorks', 5);

-- Insert data into Podizveduvac
INSERT INTO Podizveduvac (Podizveduvac_Ime, Struka, Br_vraboteni, Saatnica, UID) VALUES
('Akva Term', 'Plumbing', 3, 40.0, 7),
('Beta Elektrik', 'Electrical', 2, 45.0, 8),
('Dzidar Prom', 'Construction', 5, 30.0, 9),
('Fasada Plus', 'Construction', 4, 40.0, 10),
('Prima Krov', 'Roofing', 3, 35.0, 11),
('Dvornik Enzinering', 'Landscaping', 2, 25.0, 12),
('RoloKraft', 'Doors/Windows', 2, 35.0, 13),
('Mega Enterier', 'Interior', 4, 40.0, 14),
('FullConstruct', 'Hybrid', 7, 45.0, 15);

-- Insert data into Rabotnik
INSERT INTO Rabotnik (Maticen_br, Ime, Seniornost) VALUES
(1508198501234, 'Aleksandar', 'Senior'),
(2307199005678, 'Dimitar', 'Associate'),
(0502198802345, 'Stefan', 'Assistant'),
(1803199204567, 'Vladimir', 'Senior'),
(1012199707890, 'Nikola', 'Assistant'),
(0708198501234, 'Petar', 'Associate'),
(2203199105678, 'Igor', 'Senior'),
(0304198902345, 'Goran', 'Assistant'),
(2606199504567, 'Filip', 'Associate'),
(1207199307890, 'Mihail', 'Assistant'),
(0405198501234, 'Marko', 'Senior'),
(2306198805678, 'Dragan', 'Assistant'),
(0902199202345, 'Dejan', 'Associate'),
(1508199404567, 'Zoran', 'Senior'),
(2104199107890, 'Nenad', 'Assistant'),
(1905198701234, 'Slavko', 'Associate'),
(0802198905678, 'Milan', 'Senior'),
(2403199502345, 'Bojan', 'Assistant'),
(1706199304567, 'Mladen', 'Associate'),
(0110199107890, 'Saša', 'Assistant'),
(2601199201234, 'Arben', 'Senior'),
(1406199405678, 'Adnan', 'Associate'),
(2003199702345, 'Besnik', 'Assistant'),
(0507199004567, 'Elvir', 'Senior'),
(0704199307890, 'Agron', 'Assistant'),
(1011199101234, 'Lirim', 'Associate'),
(1806199505678, 'Alban', 'Senior'),
(3008199602345, 'Fatmir', 'Assistant'),
(1705199104567, 'Ilir', 'Associate'),
(2202199007890, 'Gazmend', 'Assistant'),
(2409198801234, 'Kristijan', 'Assistant'),
(0212199005678, 'Tome', 'Associate');

-- Insert data into Dobavuvac
INSERT INTO Dobavuvac (Dobavuvac_Ime, Klasa, Tip, Poteklo) VALUES
('MegaPlast', 'A', 'Materijal', 'Domestic'),
('GlobalSupplies', 'B', 'Oprema', 'International'),
('MetroMaterial', 'A', 'Materijal', 'Domestic'),
('UrbanTools', 'C', 'Alat', 'International'),
('CraftEquip', 'B', 'Materijal', 'International');

-- Insert data into Nabavka
INSERT INTO Nabavka (Nabavka_ID, Datum, Cena, Kolicina, Predmet) VALUES
(1, '2025-01-01', 1000.0, 50, 'Cement'),
(2, '2025-01-02', 500.0, 20, 'Steel Rods'),
(3, '2025-01-03', 300.0, 100, 'Brick'),
(4, '2025-01-04', 200.0, 10, 'Paint'),
(5, '2025-01-05', 400.0, 30, 'Wood'),
(6, '2025-01-06', 300.0, 100, 'Brick'),
(7, '2025-01-07', 800.0, 40, 'Cement'),
(8, '2025-01-08', 600.0, 25, 'Steel Rods'),
(9, '2025-01-09', 450.0, 15, 'Tiles'),
(10, '2025-01-10', 200.0, 10, 'Paint'),
(11, '2025-01-11', 350.0, 20, 'Wood'),
(12, '2025-01-12', 700.0, 35, 'Cement'),
(13, '2025-01-13', 250.0, 50, 'Brick'),
(14, '2025-01-14', 150.0, 8, 'Paint'),
(15, '2025-01-15', 500.0, 25, 'Steel Rods'),
(16, '2025-01-16', 400.0, 20, 'Plaster'),
(17, '2025-01-17', 1000.0, 30, 'Ceramics'),
(18, '2025-01-18', 300.0, 15, 'Tiles'),
(19, '2025-01-19', 200.0, 10, 'Paint'),
(20, '2025-01-20', 400.0, 50, 'Brick'),
(21, '2025-01-21', 350.0, 25, 'Cement'),
(22, '2025-01-22', 300.0, 15, 'Wood'),
(23, '2025-01-23', 600.0, 30, 'Steel Rods'),
(24, '2025-01-24', 250.0, 12, 'Tiles'),
(25, '2025-01-25', 500.0, 50, 'Brick'),
(26, '2025-01-26', 150.0, 8, 'Paint'),
(27, '2025-01-27', 700.0, 40, 'Cement'),
(28, '2025-01-28', 400.0, 20, 'Plaster'),
(29, '2025-01-29', 1000.0, 25, 'Fire Extinguishers'),
(30, '2025-01-29', 1000.0, 25, 'General Tools'),
(31, '2025-01-30', 450.0, 30, 'Safety Equipment');


-- Insert data into Objekt
INSERT INTO Objekt (Objekt_ID, Tip, Adresa) VALUES
(1, 'Commercial', 'Ulica ulicovska br. 6 Skopje'),
(2, 'Commercial', 'Ulica 23 br. 4 Skopje'),
(3, 'Commercial', 'Ulica Ruzveltova br. 8 Valandovo'),
(4, 'Mixed-Use', 'Ulica 4 br. 7 Veles'),
(5, 'Commercial', 'Ulica 17 br 2 Shtip');

-- Insert data into Vo_Izgradba
INSERT INTO Vo_Izgradba (Objekt_ID, Budzet) VALUES
(1, 500000.0),
(3, 750000.0);

-- Insert data into Gotov
INSERT INTO Gotov (Objekt_ID) VALUES
(2),
(4),
(5);

-- Insert data into Raboti_Na
INSERT INTO Raboti_Na (Objekt_ID, Podizveduvac_Ime, Saati) VALUES
(1, 'Akva Term', 45),
(1, 'Beta Elektrik', 56),
(1, 'Dzidar Prom', 54),
(1, 'Fasada Plus', 74),
(1, 'Prima Krov', 43),
(1, 'Dvornik Enzinering', 54),
(1, 'RoloKraft', 55),
(1, 'Mega Enterier', 38),
(1, 'FullConstruct', 68),
(2, 'Akva Term', 27),
(2, 'Beta Elektrik', 53),
(2, 'Dzidar Prom', 77),
(2, 'Fasada Plus', 44),
(2, 'Prima Krov', 37),
(2, 'Dvornik Enzinering', 43),
(2, 'RoloKraft', 16),
(2, 'Mega Enterier', 23),
(2, 'FullConstruct', 29); 

-- Mapping Rabotnik to Podizveduvac based on Br_vraboteni
INSERT INTO Raboti_Za (Maticen_br, Podizveduvac_Ime) VALUES
(1508198501234, 'Akva Term'),
(2307199005678, 'Akva Term'),
(0502198802345, 'Akva Term'),
(1803199204567, 'Beta Elektrik'),
(1012199707890, 'Beta Elektrik'),
(0708198501234, 'Dzidar Prom'),
(2203199105678, 'Dzidar Prom'),
(0304198902345, 'Dzidar Prom'),
(2606199504567, 'Dzidar Prom'),
(1207199307890, 'Dzidar Prom'),
(0405198501234, 'Fasada Plus'),
(2306198805678, 'Fasada Plus'),
(0902199202345, 'Fasada Plus'),
(1508199404567, 'Fasada Plus'),
(2104199107890, 'Prima Krov'),
(1905198701234, 'Prima Krov'),
(0802198905678, 'Prima Krov'),
(2403199502345, 'Dvornik Enzinering'),
(1706199304567, 'Dvornik Enzinering'),
(0110199107890, 'RoloKraft'),
(2601199201234, 'RoloKraft'),
(1406199405678, 'Mega Enterier'),
(2003199702345, 'Mega Enterier'),
(0507199004567, 'Mega Enterier'),
(0704199307890, 'Mega Enterier'),
(1011199101234, 'FullConstruct'),
(1806199505678, 'FullConstruct'),
(3008199602345, 'FullConstruct'),
(1705199104567, 'FullConstruct'),
(2202199007890, 'FullConstruct'),
(2409198801234, 'FullConstruct'),
(0212199005678, 'FullConstruct');

-- Insert data into Nadgleduva
INSERT INTO Nadgleduva (Objekt_ID, Nadzor_Ime) VALUES
(1, 'Sasha Ketic'),
(3, 'Magdalena Filipova');

-- Insert data into Pobaruva
INSERT INTO Pobaruva (Nabavka_ID, Podizveduvac_Ime) VALUES
(1, 'Akva Term'), 
(2, 'Beta Elektrik'), 
(3, 'Dzidar Prom'), 
(4, 'Fasada Plus'), 
(5, 'Prima Krov'), 
(6, 'Akva Term'), 
(7, 'Beta Elektrik'), 
(8, 'Dzidar Prom'), 
(9, 'Fasada Plus'), 
(10, 'Prima Krov'), 
(11, 'Akva Term'), 
(12, 'Beta Elektrik'),
(13, 'Dzidar Prom'), 
(14, 'Fasada Plus'), 
(15, 'Prima Krov'), 
(16, 'Akva Term'), 
(17, 'Beta Elektrik'), 
(18, 'Dzidar Prom'), 
(19, 'Fasada Plus'), 
(20, 'Prima Krov'), 
(21, 'Akva Term'),
(22, 'Beta Elektrik'), 
(23, 'Dzidar Prom'),
(24, 'Fasada Plus'), 
(25, 'Prima Krov'), 
(26, 'Akva Term'), 
(27, 'Beta Elektrik'), 
(28, 'Dzidar Prom'), 
(29, 'Fasada Plus'), 
(30, 'Prima Krov'), 
(31, 'FullConstruct');

-- Insert data into Odobruva
INSERT INTO Odobruva (Nabavka_ID, Nadzor_Ime) VALUES
(1, 'Sasha Ketic'),
(2, 'Magdalena Filipova'),
(3, 'Magdalena Filipova'),
(4, 'Sasha Ketic'),
(5, 'Magdalena Filipova'),
(6, 'Magdalena Filipova'),
(7, 'Magdalena Filipova'),
(8, 'Magdalena Filipova'),
(9, 'Sasha Ketic'),
(10, 'Sasha Ketic'),
(11, 'Magdalena Filipova'),
(12, 'Magdalena Filipova'),
(13, 'Magdalena Filipova'),
(14, 'Magdalena Filipova'),
(15, 'Magdalena Filipova'),
(16, 'Sasha Ketic'),
(17, 'Sasha Ketic'),
(18, 'Magdalena Filipova'),
(19, 'Sasha Ketic'),
(20, 'Magdalena Filipova'),
(21, 'Magdalena Filipova'),
(22, 'Magdalena Filipova'),
(23, 'Magdalena Filipova'),
(24, 'Sasha Ketic'),
(25, 'Magdalena Filipova'),
(26, 'Magdalena Filipova'),
(27, 'Sasha Ketic'),
(28, 'Sasha Ketic'),
(29, 'Sasha Ketic'),
(30, 'Sasha Ketic'),
(31, 'Magdalena Filipova');

-- Insert data into Nameneta_Za
INSERT INTO Nameneta_Za (Nabavka_ID, Objekt_ID) VALUES
(1, '3'),
(2, '1'),
(3, '1'),
(4, '1'),
(5, '3'),
(6, '3'),
(7, '3'),
(8, '3'),
(9, '1'),
(10, '1'),
(11, '3'),
(12, '3'),
(13, '3'),
(14, '3'),
(15, '3'),
(16, '1'),
(17, '1'),
(18, '3'),
(19, '1'),
(20, '3'),
(21, '3'),
(22, '3'),
(23, '3'),
(24, '1'),
(25, '3'),
(26, '3'),
(27, '1'),
(28, '1'),
(29, '1'),
(30, '1'),
(31, '3');

-- Insert data into Ispolnuva
INSERT INTO Ispolnuva (Nabavka_ID, Dobavuvac_Ime) VALUES
(1, 'GlobalSupplies'),
(2, 'MegaPlast'),
(3, 'GlobalSupplies'),
(4, 'UrbanTools'),
(5, 'MegaPlast'),
(6, 'UrbanTools'),
(7, 'CraftEquip'),
(8, 'CraftEquip'),
(9, 'UrbanTools'),
(10, 'GlobalSupplies'),
(11, 'CraftEquip'),
(12, 'GlobalSupplies'),
(13, 'UrbanTools'),
(14, 'MegaPlast'),
(15, 'GlobalSupplies'),
(16, 'UrbanTools'),
(17, 'UrbanTools'),
(18, 'GlobalSupplies'),
(19, 'MetroMaterial'),
(20, 'CraftEquip'),
(21, 'GlobalSupplies'),
(22, 'MetroMaterial'),
(23, 'MetroMaterial'),
(24, 'GlobalSupplies'),
(25, 'CraftEquip'),
(26, 'MetroMaterial'),
(27, 'MegaPlast'),
(28, 'GlobalSupplies'),
(29, 'GlobalSupplies'),
(30, 'MetroMaterial'),
(31, 'UrbanTools');

-- Insert data into Oddrzuva
INSERT INTO Oddrzuva (Objekt_ID, Podizveduvac_Ime, Saati) VALUES
(2, 'FullConstruct', 25),
(4, 'FullConstruct', 20),
(4, 'Akva Term', 43),
(5, 'FullConstruct', 12);

-- Enable foreign key checks
