| 1 | INSERT INTO users (
|
|---|
| 2 | id,
|
|---|
| 3 | email,
|
|---|
| 4 | password,
|
|---|
| 5 | role,
|
|---|
| 6 | username
|
|---|
| 7 | ) VALUES
|
|---|
| 8 | (1, 'davor@example.com', 'hashed_password_1', 'USER', 'davor'),
|
|---|
| 9 | (2, 'ana@example.com', 'hashed_password_2', 'USER', 'ana'),
|
|---|
| 10 | (3, 'marko@example.com', 'hashed_password_3', 'ADMIN', 'marko');
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | INSERT INTO stock (
|
|---|
| 14 | id,
|
|---|
| 15 | symbol,
|
|---|
| 16 | name,
|
|---|
| 17 | current_price,
|
|---|
| 18 | last_price,
|
|---|
| 19 | percentage,
|
|---|
| 20 | turnover,
|
|---|
| 21 | last_updated
|
|---|
| 22 | ) VALUES
|
|---|
| 23 | (1, 'ALK', 'Alkaloid AD Skopje', 1500.00, 1490.00, 0.67, 120000.00, '2026-01-21 10:00:00'),
|
|---|
| 24 | (2, 'KMB', 'Komercijalna banka AD Skopje', 950.50, 940.00, 1.11, 85000.00, '2026-01-21 10:00:00'),
|
|---|
| 25 | (3, 'MPT', 'Makpetrol AD Skopje', 320.75, 315.00, 1.84, 50000.00, '2026-01-21 10:00:00'),
|
|---|
| 26 | (4, 'STBP', 'Stopanska banka AD Skopje', 420.25, 410.00, 2.52, 60000.00, '2026-01-21 10:00:00');
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | INSERT INTO portfolios (
|
|---|
| 30 | id,
|
|---|
| 31 | balance,
|
|---|
| 32 | user_id
|
|---|
| 33 | ) VALUES
|
|---|
| 34 | (1, 10000.00, 1),
|
|---|
| 35 | (2, 5000.00, 2),
|
|---|
| 36 | (3, 7000.00, 3);
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | INSERT INTO portfolio_holdings (
|
|---|
| 40 | id,
|
|---|
| 41 | quantity,
|
|---|
| 42 | avg_price,
|
|---|
| 43 | stock_id,
|
|---|
| 44 | portfolio_id
|
|---|
| 45 | ) VALUES
|
|---|
| 46 | (1, 10, 1480.00, 1, 1),
|
|---|
| 47 | (2, 5, 940.00, 2, 1),
|
|---|
| 48 | (3, 20, 315.00, 3, 2),
|
|---|
| 49 | (4, 15, 410.00, 4, 3);
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | INSERT INTO stock_history (
|
|---|
| 53 | id,
|
|---|
| 54 | price,
|
|---|
| 55 | stock_id,
|
|---|
| 56 | timestamp
|
|---|
| 57 | ) VALUES
|
|---|
| 58 | (1, 1490.00, 1, '2026-01-20'),
|
|---|
| 59 | (2, 1500.00, 1, '2026-01-21'),
|
|---|
| 60 | (3, 940.00, 2, '2026-01-20'),
|
|---|
| 61 | (4, 950.50, 2, '2026-01-21'),
|
|---|
| 62 | (5, 315.00, 3, '2026-01-20'),
|
|---|
| 63 | (6, 320.75, 3, '2026-01-21'),
|
|---|
| 64 | (7, 410.00, 4, '2026-01-20'),
|
|---|
| 65 | (8, 420.25, 4, '2026-01-21');
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | INSERT INTO user_auth_providers (
|
|---|
| 69 | user_id,
|
|---|
| 70 | auth_providers
|
|---|
| 71 | ) VALUES
|
|---|
| 72 | (1, 'INTERNAL'),
|
|---|
| 73 | (2, 'GOOGLE'),
|
|---|
| 74 | (3, 'INTERNAL');
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | INSERT INTO watchlist (
|
|---|
| 78 | id,
|
|---|
| 79 | price_above,
|
|---|
| 80 | price_below,
|
|---|
| 81 | stock_id,
|
|---|
| 82 | user_id
|
|---|
| 83 | ) VALUES
|
|---|
| 84 | (1, 1550.00, 1450.00, 1, 1),
|
|---|
| 85 | (2, 1000.00, 900.00, 2, 1),
|
|---|
| 86 | (3, 330.00, 310.00, 3, 2),
|
|---|
| 87 | (4, 430.00, 400.00, 4, 3);
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | INSERT INTO trade_request (
|
|---|
| 91 | id,
|
|---|
| 92 | portfolio_id,
|
|---|
| 93 | price_per_unit,
|
|---|
| 94 | quantity,
|
|---|
| 95 | status,
|
|---|
| 96 | stock_id,
|
|---|
| 97 | timestamp,
|
|---|
| 98 | type
|
|---|
| 99 | ) VALUES
|
|---|
| 100 | (1, 1, 1510.00, 5, 'PENDING', 1, '2026-02-02 09:00:00', 'BUY'),
|
|---|
| 101 | (2, 2, 325.00, 10, 'PENDING', 3, '2026-02-02 09:30:00', 'SELL'),
|
|---|
| 102 | (3, 1, 960.00, 3, 'PENDING', 2, '2026-02-02 10:00:00', 'BUY');
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 | INSERT INTO transactions (
|
|---|
| 106 | id,
|
|---|
| 107 | type,
|
|---|
| 108 | quantity,
|
|---|
| 109 | price,
|
|---|
| 110 | timestamp,
|
|---|
| 111 | origin,
|
|---|
| 112 | user_id,
|
|---|
| 113 | stock_id,
|
|---|
| 114 | trade_request_id
|
|---|
| 115 | ) VALUES
|
|---|
| 116 | (1, 'BUY', 5, 1510.00, '2026-02-02 09:05:00', 'INTERNAL', 1, 1, 1),
|
|---|
| 117 | (2, 'SELL', 10, 325.00, '2026-02-02 09:35:00', 'INTERNAL', 2, 3, 2),
|
|---|
| 118 | (3, 'BUY', 3, 960.00, '2026-02-02 10:05:00', 'INTERNAL', 1, 2, 3);
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 | UPDATE trade_request
|
|---|
| 122 | SET status = 'COMPLETED'
|
|---|
| 123 | WHERE id IN (1, 2, 3);
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 | INSERT INTO oauth_pending_links (
|
|---|
| 127 | token,
|
|---|
| 128 | email,
|
|---|
| 129 | provider,
|
|---|
| 130 | expires_at,
|
|---|
| 131 | created_at,
|
|---|
| 132 | user_id,
|
|---|
| 133 | auth_provider_id
|
|---|
| 134 | ) VALUES
|
|---|
| 135 | (
|
|---|
| 136 | 'token-davor-123',
|
|---|
| 137 | 'davor@example.com',
|
|---|
| 138 | 'INTERNAL',
|
|---|
| 139 | '2026-02-02 11:00:00',
|
|---|
| 140 | '2026-02-02 10:00:00',
|
|---|
| 141 | 1,
|
|---|
| 142 | 1
|
|---|
| 143 | ),
|
|---|
| 144 | (
|
|---|
| 145 | 'token-ana-123',
|
|---|
| 146 | 'ana@example.com',
|
|---|
| 147 | 'GOOGLE',
|
|---|
| 148 | '2026-02-02 11:30:00',
|
|---|
| 149 | '2026-02-02 10:30:00',
|
|---|
| 150 | 2,
|
|---|
| 151 | 2
|
|---|
| 152 | );
|
|---|