SET search_path TO trekr;

INSERT INTO USERS (user_id, email, username, password) VALUES
(1, 'dimitar@example.com', 'dimitar_arsov', '$2a$10$examplehash1'),
(2, 'filip@example.com', 'filip_gavrilovski', '$2a$10$examplehash2'),
(3, 'marko@example.com', 'marko_markovski', '$2a$10$examplehash3'),
(4, 'andrej.shumanovski@gmail.com', 'andrej_shumanovski', '1234'),
(5, 'angelovski.mario222@gmail.com', 'angelovski_mario', '1234'),
(6, 'ana@example.com', 'ana_ilievska', '$2a$10$examplehash6'),
(7, 'petar@example.com', 'petar_stojanov', '$2a$10$examplehash7'),
(8, 'elena@example.com', 'elena_ristova', '$2a$10$examplehash8'),
(9, 'stefan@example.com', 'stefan_nikolov', '$2a$10$examplehash9'),
(10, 'ivana@example.com', 'ivana_karapandzova', '$2a$10$examplehash10'),
(11, 'nikola@example.com', 'nikola_ivanov', '1234'),
(12, 'marija@example.com', 'marija_petrova', '1234'),
(13, 'viktor@example.com', 'viktor_stojkov', '1234'),
(14, 'katerina@example.com', 'katerina_ristevska', '1234'),
(15, 'jovan@example.com', 'jovan_mitev', '1234'),
(16, 'teodora@example.com', 'teodora_angelova', '1234'),
(17, 'bojan@example.com', 'bojan_popov', '1234'),
(18, 'sara@example.com', 'sara_karovska', '1234'),
(19, 'aleksandar@example.com', 'aleksandar_dimitrov', '1234'),
(20, 'milena@example.com', 'milena_stefanovska', '1234'),
(21, 'goran@example.com', 'goran_iliev', '1234'),
(22, 'kristina@example.com', 'kristina_georgieva', '1234'),
(23, 'martin@example.com', 'martin_danev', '1234'),
(24, 'ema@example.com', 'ema_spasovska', '1234'),
(25, 'daniel@example.com', 'daniel_nikolov', '1234'),
(26, 'irena@example.com', 'irena_jovanovska', '1234'),
(27, 'stojan@example.com', 'stojan_tasev', '1234'),
(28, 'vanja@example.com', 'vanja_trajkovska', '1234'),
(29, 'petra@example.com', 'petra_kostova', '1234'),
(30, 'vlado@example.com', 'vlado_ilievski', '1234');

-- If USERS.user_id is an IDENTITY column, ensure its backing sequence is advanced
-- past the inserted dummy ids so future inserts (e.g., app registration) don't
-- try to reuse ids and fail with duplicate key errors.
SELECT setval(
	pg_get_serial_sequence('trekr.users', 'user_id'),
	(SELECT COALESCE(MAX(user_id), 0) FROM trekr.users)
);

INSERT INTO FINANCE_USERS (user_id, spending_budget, saving_budget, investing_budget, donation_budget, credit) VALUES
(1, 500, 200, 300, 50, 1000),
(2, 600, 250, 200, 30, 500),
(3, 400, 150, 250, 20, 0),
(4, 1000, 500, 500, 100, 2000),
(5, 700, 300, 200, 40, 800),
(6, 450, 150, 150, 20, 200),
(7, 900, 350, 250, 60, 1200),
(8, 550, 200, 300, 25, 0),
(9, 800, 300, 400, 50, 1500),
(10, 650, 250, 200, 30, 400),
(11, 750, 250, 200, 25, 600),
(12, 520, 220, 180, 15, 300),
(13, 900, 400, 350, 40, 1500),
(14, 480, 180, 120, 10, 200),
(15, 1100, 500, 450, 70, 2500),
(16, 650, 250, 200, 20, 400),
(17, 700, 260, 240, 25, 850),
(18, 560, 210, 160, 15, 150),
(19, 980, 420, 380, 55, 1800),
(20, 600, 230, 220, 20, 500),
(21, 430, 160, 120, 10, 0),
(22, 820, 330, 260, 35, 1100),
(23, 740, 290, 240, 30, 700),
(24, 500, 200, 150, 15, 250),
(25, 1200, 550, 500, 80, 3000);

INSERT INTO INCOMES (income_id, user_id, date, amount) VALUES
(1, 1, '2026-01-01', 2000),
(2, 2, '2026-01-03', 1800),
(3, 3, '2026-01-05', 2200),
(4, 4, '2026-01-07', 5000),
(5, 5, '2026-01-08', 3200),
(6, 6, '2026-01-10', 1600),
(7, 7, '2026-01-12', 4100),
(8, 8, '2026-01-14', 2300),
(9, 9, '2026-01-16', 3700),
(10, 10, '2026-01-18', 1900),
(11, 11, '2026-02-01', 2600),
(12, 11, '2026-03-01', 2600),
(13, 12, '2026-02-03', 2100),
(14, 12, '2026-03-03', 2150),
(15, 13, '2026-02-05', 3300),
(16, 13, '2026-03-05', 3400),
(17, 14, '2026-02-07', 1900),
(18, 14, '2026-03-07', 1950),
(19, 15, '2026-02-09', 5200),
(20, 15, '2026-03-09', 5200),
(21, 16, '2026-02-11', 2400),
(22, 16, '2026-03-11', 2450),
(23, 17, '2026-02-13', 2700),
(24, 17, '2026-03-13', 2750),
(25, 18, '2026-02-15', 2200),
(26, 18, '2026-03-15', 2250),
(27, 19, '2026-02-17', 4100),
(28, 19, '2026-03-17', 4150),
(29, 20, '2026-02-19', 2500),
(30, 20, '2026-03-19', 2550),
(31, 21, '2026-02-21', 1600),
(32, 22, '2026-02-23', 2900),
(33, 22, '2026-03-23', 2950),
(34, 23, '2026-02-25', 2750),
(35, 23, '2026-03-25', 2800),
(36, 24, '2026-02-27', 2050),
(37, 24, '2026-03-27', 2100),
(38, 25, '2026-02-28', 6000),
(39, 25, '2026-03-28', 6050);

INSERT INTO TRAINING_USERS (user_id, gender, age, weight) VALUES
(1, 'Male', 21, 73),
(2, 'Male', 23, 80),
(3, 'Male', 22, 78),
(4, 'Female', 25, 65),
(5, 'Male', 24, 86),
(6, 'Female', 22, 58),
(7, 'Male', 28, 92),
(8, 'Female', 26, 70),
(9, 'Male', 30, 83),
(10, 'Female', 21, 62),
(11, 'Male', 27, 82),
(12, 'Female', 24, 61),
(13, 'Male', 29, 90),
(14, 'Female', 23, 57),
(15, 'Male', 31, 88),
(16, 'Female', 28, 66),
(17, 'Male', 26, 76),
(18, 'Female', 22, 55),
(19, 'Male', 33, 94),
(20, 'Female', 30, 69);

INSERT INTO WEIGHT_USERS (user_id, weight, height, goal_weight, goal_calories) VALUES
(1, 73, 181, 70, 2500),
(2, 80, 185, 75, 2600),
(3, 78, 180, 74, 2400),
(4, 65, 170, 60, 2000),
(5, 86, 188, 80, 2800),
(6, 58, 165, 55, 1900),
(7, 92, 190, 85, 3000),
(8, 70, 172, 66, 2100),
(9, 83, 179, 78, 2500),
(10, 62, 168, 58, 2000),
(11, 82, 183, 78, 2600),
(12, 61, 169, 58, 2000),
(13, 90, 191, 85, 2900),
(14, 57, 164, 55, 1900),
(15, 88, 186, 82, 2800),
(16, 66, 172, 62, 2100),
(17, 76, 179, 72, 2500),
(18, 55, 162, 53, 1850),
(19, 94, 193, 88, 3100),
(20, 69, 173, 65, 2200);

INSERT INTO DAILY_INTAKES (daily_intake_id, user_id, calories, date) VALUES
(1, 1, 2400, '2026-02-01'),
(2, 2, 2500, '2026-02-01'),
(3, 3, 2300, '2026-02-01'),
(4, 4, 2100, '2026-02-02'),
(5, 5, 2750, '2026-02-02'),
(6, 6, 1850, '2026-02-02'),
(7, 7, 2950, '2026-02-03'),
(8, 8, 2050, '2026-02-03'),
(9, 9, 2450, '2026-02-03'),
(10, 10, 1950, '2026-02-04'),
(11, 11, 2550, '2026-02-05'),
(12, 11, 2450, '2026-02-06'),
(13, 12, 1980, '2026-02-05'),
(14, 12, 2050, '2026-02-06'),
(15, 13, 2850, '2026-02-06'),
(16, 13, 2950, '2026-02-07'),
(17, 14, 1850, '2026-02-06'),
(18, 14, 1900, '2026-02-07'),
(19, 15, 2700, '2026-02-07'),
(20, 15, 2750, '2026-02-08'),
(21, 16, 2150, '2026-02-07'),
(22, 16, 2250, '2026-02-08'),
(23, 17, 2400, '2026-02-08'),
(24, 17, 2500, '2026-02-09'),
(25, 18, 1800, '2026-02-08'),
(26, 18, 1900, '2026-02-09'),
(27, 19, 3000, '2026-02-09'),
(28, 19, 3100, '2026-02-10'),
(29, 20, 2200, '2026-02-09'),
(30, 20, 2300, '2026-02-10');

INSERT INTO TRAINING_SESSIONS (training_id, training_user_id, weight_user_id, duration, calories, date, type) VALUES
(1, 1, 1, 60, 500, '2026-02-01', 'Running'),
(2, 2, 2, 45, 400, '2026-02-01', 'Cycling'),
(3, 3, 3, 30, 300, '2026-02-01', 'Swimming'),
(4, 4, 4, 50, 420, '2026-02-02', 'HIIT'),
(5, 5, 5, 40, 350, '2026-02-02', 'Strength'),
(6, 6, 6, 35, 280, '2026-02-02', 'Yoga'),
(7, 7, 7, 55, 520, '2026-02-03', 'Running'),
(8, 8, 8, 45, 390, '2026-02-03', 'Cycling'),
(9, 9, 9, 30, 260, '2026-02-03', 'Rowing'),
(10, 10, 10, 60, 480, '2026-02-04', 'Swimming'),
(11, 11, 11, 50, 430, '2026-02-05', 'Strength'),
(12, 12, 12, 40, 310, '2026-02-05', 'Yoga'),
(13, 13, 13, 60, 540, '2026-02-06', 'Running'),
(14, 14, 14, 35, 260, '2026-02-06', 'Pilates'),
(15, 15, 15, 45, 390, '2026-02-07', 'Cycling'),
(16, 16, 16, 55, 460, '2026-02-07', 'HIIT'),
(17, 17, 17, 30, 240, '2026-02-08', 'Rowing'),
(18, 18, 18, 65, 520, '2026-02-08', 'Swimming'),
(19, 19, 19, 50, 440, '2026-02-09', 'Running'),
(20, 20, 20, 45, 370, '2026-02-09', 'Strength'),
(21, 11, 11, 35, 300, '2026-02-12', 'Cycling'),
(22, 13, 13, 30, 260, '2026-02-12', 'Core'),
(23, 15, 15, 70, 600, '2026-02-13', 'Long Run'),
(24, 17, 17, 40, 320, '2026-02-13', 'Strength');

INSERT INTO DISCIPLINE_USERS (user_id, num_tasks, tasks) VALUES
(1, 2, '["Morning Run","Read Book"]'),
(2, 1, '["Meditation"]'),
(3, 3, '["Plan Day","No Sugar","Stretch"]'),
(4, 2, '["Drink Water","Walk 8k Steps"]'),
(5, 2, '["Journal","Gym"]'),
(6, 1, '["Study 1h"]'),
(7, 2, '["Stretch 10m","No Soda"]'),
(8, 2, '["Walk 30m","Sleep 7h"]'),
(9, 3, '["Read 20p","Meditate","No Sugar"]'),
(10, 1, '["Drink Water"]'),
(11, 3, '["Morning Run","Plan Day","Study 1h"]'),
(12, 2, '["Yoga","Cook Healthy"]'),
(13, 2, '["Gym","Protein Target"]'),
(14, 2, '["Journal","Early Bed"]'),
(15, 3, '["Duolingo","No Alcohol","Walk 8k Steps"]');

INSERT INTO CUSTOM_TRACKING_CATEGORIES (custom_tracking_id, user_id, name, num_tasks, tasks) VALUES
(1, 1, 'Project Trekr', 2, '["Code Review","Push Updates"]'),
(2, 2, 'Language Learning', 2, '["Duolingo","Watch Lesson"]'),
(3, 3, 'Side Hustle', 3, '["Client Outreach","Build Feature","Invoice"]'),
(4, 5, 'Fitness Plan', 2, '["Protein Target","Sleep 8h"]'),
(5, 6, 'Exam Prep', 2, '["Practice Problems","Review Notes"]'),
(6, 11, 'University', 3, '["Attend Lecture","Solve Tasks","Review"]'),
(7, 12, 'Health', 2, '["Steps","Water"]'),
(8, 13, 'Startup', 3, '["Pitch","Build","Ship"]'),
(9, 14, 'Cooking', 2, '["Meal Prep","Groceries"]'),
(10, 15, 'Reading List', 2, '["Read Fiction","Read Nonfiction"]'),
(11, 16, 'Work Sprint', 3, '["Standup","Tickets","PR Review"]'),
(12, 17, 'Finance Goals', 2, '["Track Expenses","Invest"]'),
(13, 18, 'Language', 2, '["Duolingo","Podcast"]'),
(14, 19, 'Gym Program', 3, '["Squat","Bench","Deadlift"]'),
(15, 20, 'Exam Prep', 3, '["Practice","Mock","Review"]');

INSERT INTO TASKS (task_id, name, is_finished, discipline_user_id, custom_tracking_id) VALUES
(1, 'Morning Run', FALSE, 1, NULL),
(2, 'Read Book', FALSE, 1, NULL),
(3, 'Meditation', FALSE, 2, NULL),
(4, 'Code Review', FALSE, NULL, 1),
(5, 'Push Updates', FALSE, NULL, 1),
(6, 'Plan Day', FALSE, 3, NULL),
(7, 'No Sugar', FALSE, 3, NULL),
(8, 'Stretch', FALSE, 3, NULL),
(9, 'Drink Water', FALSE, 4, NULL),
(10, 'Walk 8k Steps', FALSE, 4, NULL),
(11, 'Journal', FALSE, 5, NULL),
(12, 'Gym', FALSE, 5, NULL),
(13, 'Duolingo', FALSE, NULL, 2),
(14, 'Watch Lesson', FALSE, NULL, 2),
(15, 'Practice Problems', FALSE, NULL, 5),
(16, 'Stretch 10m', FALSE, 7, NULL),
(17, 'No Soda', FALSE, 7, NULL),
(18, 'Walk 30m', FALSE, 8, NULL),
(19, 'Sleep 7h', FALSE, 8, NULL),
(20, 'Read 20p', FALSE, 9, NULL),
(21, 'Meditate', FALSE, 9, NULL),
(22, 'No Sugar', FALSE, 9, NULL),
(23, 'Drink Water', FALSE, 10, NULL),
(24, 'Morning Run', FALSE, 11, NULL),
(25, 'Plan Day', FALSE, 11, NULL),
(26, 'Study 1h', FALSE, 11, NULL),
(27, 'Yoga', FALSE, 12, NULL),
(28, 'Cook Healthy', FALSE, 12, NULL),
(29, 'Gym', FALSE, 13, NULL),
(30, 'Protein Target', FALSE, 13, NULL),
(31, 'Journal', FALSE, 14, NULL),
(32, 'Early Bed', FALSE, 14, NULL),
(33, 'Duolingo', FALSE, 15, NULL),
(34, 'No Alcohol', FALSE, 15, NULL),
(35, 'Walk 8k Steps', FALSE, 15, NULL),
(36, 'Attend Lecture', FALSE, NULL, 6),
(37, 'Solve Tasks', FALSE, NULL, 6),
(38, 'Review', FALSE, NULL, 6),
(39, 'Steps', FALSE, NULL, 7),
(40, 'Water', FALSE, NULL, 7),
(41, 'Pitch', FALSE, NULL, 8),
(42, 'Build', FALSE, NULL, 8),
(43, 'Ship', FALSE, NULL, 8),
(44, 'Meal Prep', FALSE, NULL, 9),
(45, 'Groceries', FALSE, NULL, 9),
(46, 'Read Fiction', FALSE, NULL, 10),
(47, 'Read Nonfiction', FALSE, NULL, 10),
(48, 'Standup', FALSE, NULL, 11),
(49, 'Tickets', FALSE, NULL, 11),
(50, 'PR Review', FALSE, NULL, 11),
(51, 'Track Expenses', FALSE, NULL, 12),
(52, 'Invest', FALSE, NULL, 12),
(53, 'Duolingo Session', FALSE, NULL, 13),
(54, 'Podcast', FALSE, NULL, 13),
(55, 'Squat', FALSE, NULL, 14),
(56, 'Bench', FALSE, NULL, 14),
(57, 'Deadlift', FALSE, NULL, 14),
(58, 'Practice', FALSE, NULL, 15),
(59, 'Mock', FALSE, NULL, 15),
(60, 'Review Exam', FALSE, NULL, 15);

INSERT INTO DAILY_COMPLETION (daily_completion_id, user_id, date, procent) VALUES
(1, 1, '2026-02-01', 100),
(2, 2, '2026-02-01', 50),
(3, 3, '2026-02-01', 67),
(4, 4, '2026-02-01', 50),
(5, 5, '2026-02-02', 100),
(6, 6, '2026-02-02', 0),
(7, 7, '2026-02-03', 80),
(8, 8, '2026-02-03', 60),
(9, 9, '2026-02-03', 40),
(10, 10, '2026-02-04', 90),
(11, 11, '2026-02-05', 66),
(12, 11, '2026-02-06', 33),
(13, 12, '2026-02-05', 50),
(14, 12, '2026-02-06', 100),
(15, 13, '2026-02-06', 67),
(16, 13, '2026-02-07', 34),
(17, 14, '2026-02-06', 50),
(18, 14, '2026-02-07', 50),
(19, 15, '2026-02-07', 67),
(20, 15, '2026-02-08', 33),
(21, 16, '2026-02-07', 34),
(22, 16, '2026-02-08', 67),
(23, 17, '2026-02-08', 50),
(24, 17, '2026-02-09', 50),
(25, 18, '2026-02-08', 100),
(26, 18, '2026-02-09', 50),
(27, 19, '2026-02-09', 67),
(28, 19, '2026-02-10', 34),
(29, 20, '2026-02-09', 33),
(30, 20, '2026-02-10', 66);

INSERT INTO TASK_DAILY_COMPLETION (task_id, daily_completion_id) VALUES
(1, 1),
(2, 1),
(3, 2),
(6, 3),
(7, 3),
(9, 4),
(11, 5),
(12, 5),
(13, 8),
(14, 8),
(15, 10),
(24, 11),
(25, 11),
(27, 13),
(28, 14),
(41, 15),
(42, 15),
(44, 17),
(45, 18),
(33, 19),
(34, 19),
(51, 22),
(52, 22),
(39, 23),
(40, 24),
(53, 25),
(54, 26),
(55, 27),
(56, 27),
(57, 28),
(58, 30);

INSERT INTO INVESTOR_USERS (user_id) VALUES
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15);

INSERT INTO ASSETS (asset_id, user_id, ticker_symbol, buy_price, buy_date, quantity) VALUES
(1, 1, 'AAPL', 150, '2026-01-01', 1.5),
(2, 1, 'TSLA', 700, '2026-01-10', 2),
(3, 2, 'GOOGL', 2800, '2026-01-15', 1),
(4, 3, 'MSFT', 320, '2026-01-20', 1),
(5, 4, 'AMZN', 155, '2026-01-22', 1),
(6, 5, 'NVDA', 610, '2026-01-25', 1),
(7, 6, 'SPY', 480, '2026-01-28', 1),
(8, 1, 'ETH', 2400, '2026-01-30', 1),
(9, 7, 'KO', 58, '2026-02-02', 10),
(10, 8, 'V', 245, '2026-02-03', 3),
(11, 9, 'NFLX', 610, '2026-02-04', 1),
(12, 10, 'DIS', 110, '2026-02-05', 4),
(13, 11, 'AAPL', 155, '2026-02-06', 2),
(14, 12, 'MSFT', 330, '2026-02-07', 1.2),
(15, 13, 'TSLA', 720, '2026-02-08', 0.8),
(16, 14, 'SPY', 485, '2026-02-09', 1.5),
(17, 15, 'NVDA', 640, '2026-02-10', 0.9);