-- ============================================================================
--  Ororo Markets — master data / seed
--
--  Mirrors the catalogues the UI renders (src/data/*) so the app has real rows
--  to talk to as soon as the PHP API exists. Every statement is INSERT IGNORE
--  with explicit ids, so re-running the file never overwrites rows an admin has
--  since edited.
--
--  Demo credentials (change them before going anywhere near production):
--    admin@ororomarkets.test  / Admin@123   role: admin
--    user@ororomarkets.test   / User@123    role: user
--    maria@ororomarkets.test  / User@123    role: user (pending KYC)
--
--  Apply after schema.sql:  mysql -u root -p your_database < seed.sql
--
--  Passwords are seeded as typed, matching Account::HASH_PASSWORDS = false in
--  backend/_includes/classes/Account.php.
-- ============================================================================

SET NAMES utf8mb4;

-- ---------------------------------------------------------------------------
-- Roles and permissions
-- ---------------------------------------------------------------------------

INSERT IGNORE INTO roles (id, name, label, description, is_system) VALUES
  (1, 'admin', 'Administrator', 'Full access, including the Manage page and the Settings drawer', 1),
  (2, 'user',  'User',          'Trading account: every page in the sidebar except Manage', 1);

-- is_admin_only = 1 marks the surfaces the user role must never reach.
INSERT IGNORE INTO permissions (id, name, area, label, is_admin_only) VALUES
  (1,  'dashboard.view',               'dashboard',    'View dashboard', 0),
  (2,  'deposit.create',               'deposit',      'Create deposits', 0),
  (3,  'withdrawal.create',            'withdrawal',   'Request withdrawals', 0),
  (4,  'assets.view',                  'assets',       'View assets', 0),
  (5,  'assets.cold_storage',          'assets',       'Move assets into cold storage', 0),
  (6,  'cards.request',                'cards',        'Request a card', 0),
  (7,  'subscribe.create',             'subscription', 'Buy subscription plans', 0),
  (8,  'signals.purchase',             'signals',      'Buy signal products', 0),
  (9,  'wallet.connect',               'wallet',       'Connect a wallet', 0),
  (10, 'stocks.trade',                 'investing',    'Buy and sell stocks', 0),
  (11, 'copy_trading.subscribe',       'copy_trading', 'Copy an expert', 0),
  (12, 'mining.order',                 'mining',       'Open a mining pool', 0),
  (13, 'real_estate.invest',           'real_estate',  'Invest in a project', 0),
  (14, 'stake.create',                 'stake',        'Open a stake', 0),
  (15, 'referrals.view',               'referrals',    'View referrals and claim rewards', 0),
  (16, 'markets.view',                 'markets',      'View markets and watchlist', 0),
  (17, 'trade.place',                  'trade',        'Place trade orders', 0),
  (18, 'profile.update',               'account',      'Update own profile', 0),
  (19, 'security.update',              'account',      'Update own password and 2FA', 0),
  (20, 'notifications.view',           'notifications','Read own notifications', 0),
  (21, 'manage.users.view',            'manage',       'Manage > Users (list and detail)', 1),
  (22, 'manage.users.edit',            'manage',       'Edit user profiles', 1),
  (23, 'manage.users.delete',          'manage',       'Delete (soft) a user', 1),
  (24, 'manage.users.adjust_balance',  'manage',       'Credit / debit a user balance', 1),
  (25, 'manage.users.verify',          'manage',       'Verify or reject KYC', 1),
  (26, 'manage.payments.view',         'manage',       'Manage > Payments and Transactions', 1),
  (27, 'manage.withdrawals.review',    'manage',       'Approve or decline withdrawals', 1),
  (28, 'manage.experts.manage',        'manage',       'Manage > Experts', 1),
  (29, 'manage.trades.view',           'manage',       'Manage > Trades', 1),
  (30, 'manage.signals.manage',        'manage',       'Manage > Signals', 1),
  (31, 'manage.cards.review',          'manage',       'Manage > Cards', 1),
  (32, 'manage.subscriptions.view',    'manage',       'Manage > Subscriptions', 1),
  (33, 'manage.investments.view',      'manage',       'Manage > Investments', 1),
  (34, 'manage.stakings.view',         'manage',       'Manage > Stakings', 1),
  (35, 'manage.minings.view',          'manage',       'Manage > Minings', 1),
  (36, 'settings.general.update',      'settings',     'Settings > General', 1),
  (37, 'settings.deposit.update',      'settings',     'Settings > Deposit', 1),
  (38, 'settings.withdrawal.update',   'settings',     'Settings > Withdrawal', 1),
  (39, 'settings.assets.manage',       'settings',     'Settings > Add crypto', 1),
  (40, 'settings.interface.update',    'settings',     'Settings > Interface (theme and accent)', 1),
  (41, 'settings.experts.manage',      'settings',     'Settings > Copy Experts', 1),
  (42, 'settings.mining.manage',       'settings',     'Settings > Mining', 1),
  (43, 'settings.referral.update',     'settings',     'Settings > Referrals', 1),
  (44, 'settings.cards.manage',        'settings',     'Settings > Cards', 1),
  (45, 'settings.levels.manage',       'settings',     'Settings > Levels (edit modal)', 1),
  (46, 'notifications.broadcast',      'notifications','Send a notification to users', 1),
  (47, 'audit.view',                   'audit',        'Read the admin activity log', 1),
  (48, 'catalog.plans.manage',         'catalog',      'Add and edit subscription plans', 1),
  (49, 'catalog.projects.manage',      'catalog',      'Add and edit real-estate projects', 1),
  (50, 'catalog.trades.manage',        'catalog',      'Create, edit and settle trades', 1);

-- admin: everything. user: every permission that is not admin-only.
INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id FROM roles r JOIN permissions p WHERE r.name = 'admin';

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id FROM roles r JOIN permissions p ON p.is_admin_only = 0 WHERE r.name = 'user';

-- ---------------------------------------------------------------------------
-- Reference catalogues
-- ---------------------------------------------------------------------------

-- The signup picker in src/data/auth.js carries the full 66-country list; this
-- is a working subset with ISO codes and dial codes.
INSERT IGNORE INTO countries (id, code, name, dial_code) VALUES
  (1,  'US', 'United States', '+1'),
  (2,  'GB', 'United Kingdom', '+44'),
  (3,  'CA', 'Canada', '+1'),
  (4,  'AU', 'Australia', '+61'),
  (5,  'DE', 'Germany', '+49'),
  (6,  'FR', 'France', '+33'),
  (7,  'ES', 'Spain', '+34'),
  (8,  'IT', 'Italy', '+39'),
  (9,  'NL', 'Netherlands', '+31'),
  (10, 'CH', 'Switzerland', '+41'),
  (11, 'SE', 'Sweden', '+46'),
  (12, 'NO', 'Norway', '+47'),
  (13, 'BR', 'Brazil', '+55'),
  (14, 'MX', 'Mexico', '+52'),
  (15, 'ZA', 'South Africa', '+27'),
  (16, 'NG', 'Nigeria', '+234'),
  (17, 'KE', 'Kenya', '+254'),
  (18, 'GH', 'Ghana', '+233'),
  (19, 'AE', 'United Arab Emirates', '+971'),
  (20, 'IN', 'India', '+91'),
  (21, 'SG', 'Singapore', '+65'),
  (22, 'JP', 'Japan', '+81'),
  (23, 'KR', 'South Korea', '+82'),
  (24, 'CN', 'China', '+86'),
  (25, 'AD', 'Andorra', '+376'),   -- default country on the signup form
  (26, 'TR', 'Turkey', '+90'),
  (27, 'RU', 'Russia', '+7'),
  (28, 'PT', 'Portugal', '+351');

INSERT IGNORE INTO currencies (id, code, name, symbol) VALUES
  (1, 'USD', 'US Dollar', '$'),
  (2, 'EUR', 'Euro', '€'),
  (3, 'GBP', 'British Pound', '£'),
  (4, 'JPY', 'Japanese Yen', '¥'),
  (5, 'AUD', 'Australian Dollar', 'A$'),
  (6, 'CAD', 'Canadian Dollar', 'C$'),
  (7, 'CHF', 'Swiss Franc', 'CHF'),
  (8, 'CNY', 'Chinese Yuan', '¥');

-- The 116-entry language picker lives in src/data/languages.js; these are the
-- locales that ship with a complete dictionary (src/i18n).
INSERT IGNORE INTO locales (id, code, name, flag_code, is_translated) VALUES
  (1,  'en', 'English',    'gb', 1),
  (2,  'es', 'Spanish',    'es', 1),
  (3,  'fr', 'French',     'fr', 1),
  (4,  'de', 'German',     'de', 1),
  (5,  'pt', 'Portuguese', 'pt', 1),
  (6,  'ru', 'Russian',    'ru', 1),
  (7,  'zh', 'Chinese',    'cn', 1),
  (8,  'ja', 'Japanese',   'jp', 1),
  (9,  'ko', 'Korean',     'kr', 1),
  (10, 'hi', 'Hindi',      'in', 1),
  (11, 'ar', 'Arabic',     'sa', 1),
  (12, 'tr', 'Turkish',    'tr', 1);

-- Settings > Levels, in the order the panel lists them. profit_limit NULL is
-- the "Unlimited Balance" checkbox in the edit modal.
INSERT IGNORE INTO account_levels (id, slug, name, minimum_balance, profit_limit, commission_percent, sort_order) VALUES
  (1, 'bronze',  'Bronze',  300000.00, 0.00,   1.00, 1),
  (2, 'silver',  'Silver',  500000.00, 0.00,   1.00, 2),
  (3, 'starter', 'Starter', 150000.00, 0.00,   1.00, 3),
  (4, 'gold',    'Gold',   1000000.00, 0.00,   1.00, 4),
  (5, 'vip',     'VIP',          0.00, NULL,   1.00, 5);

INSERT IGNORE INTO networks (id, name, slug, chain) VALUES
  (1, 'Bitcoin', 'bitcoin', 'Bitcoin'),
  (2, 'ERC20',   'erc20',   'Ethereum'),
  (3, 'TRC20',   'trc20',   'Tron'),
  (4, 'BEP20',   'bep20',   'BNB Smart Chain'),
  (5, 'Solana',  'solana',  'Solana'),
  (6, 'Polygon', 'polygon', 'Polygon');

-- Asset catalogue. Prices are placeholders; the live app streams real quotes.
-- Every stock the Investing picker lists is seeded below; the remaining
-- Markets catalogue can be bulk-loaded from src/data/assets.js.
INSERT IGNORE INTO assets (id, symbol, name, type, icon_color, price_usd, is_depositable, is_withdrawable, is_cold_storage_enabled, sort_order) VALUES
  (1,  'BTC',   'Bitcoin',      'crypto', '#f7931a',  67250.00000000, 1, 1, 1, 1),
  (2,  'ETH',   'Ethereum',     'crypto', '#627eea',   3512.40000000, 1, 1, 1, 2),
  (3,  'USDT',  'Tether',       'crypto', '#26a17b',      1.00000000, 1, 1, 1, 3),
  (4,  'USDC',  'USD Coin',     'crypto', '#2775ca',      1.00000000, 1, 1, 1, 4),
  (5,  'BNB',   'BNB',          'crypto', '#f3ba2f',    584.20000000, 1, 1, 1, 5),
  (6,  'SOL',   'Solana',       'crypto', '#14f195',    168.90000000, 1, 1, 1, 6),
  (7,  'XRP',   'XRP',          'crypto', '#23292f',      0.62000000, 1, 1, 1, 7),
  (8,  'ADA',   'Cardano',      'crypto', '#0033ad',      0.45000000, 1, 1, 1, 8),
  (9,  'DOGE',  'Dogecoin',     'crypto', '#c2a633',      0.16000000, 1, 1, 1, 9),
  (10, 'TRX',   'TRON',         'crypto', '#eb0029',      0.13000000, 1, 1, 1, 10),
  (11, 'MATIC', 'Polygon',      'crypto', '#8247e5',      0.58000000, 1, 1, 1, 11),
  (12, 'AVAX',  'Avalanche',    'crypto', '#e84142',     36.70000000, 1, 1, 1, 12),
  (13, 'LTC',   'Litecoin',     'crypto', '#bfbbbb',     84.30000000, 1, 1, 1, 13),
  (14, 'DOT',   'Polkadot',     'crypto', '#e6007a',      6.85000000, 1, 1, 1, 14),
  (15, 'LINK',  'Chainlink',    'crypto', '#2a5ada',     17.20000000, 1, 1, 1, 15),
  (16, 'XLM',   'Stellar',      'crypto', '#7d00ff',      0.11500000, 1, 1, 1, 16),
  (17, 'USD',   'US Dollar',    'fiat',   '#85bb65',      1.00000000, 1, 0, 0, 90),
  (18, 'EUR',   'Euro',         'fiat',   '#003399',      1.08000000, 1, 0, 0, 91),
  (19, 'GBP',   'British Pound','fiat',   '#012169',      1.27000000, 1, 0, 0, 92),
  (20, 'AAPL',  'Apple',        'stock',  '#c7c7c7',    231.40000000, 0, 0, 0, 200),
  (21, 'TSLA',  'Tesla',        'stock',  '#e82127',    248.50000000, 0, 0, 0, 201),
  (22, 'MSFT',  'Microsoft',    'stock',  '#f25022',    428.90000000, 0, 0, 0, 202),
  (23, 'AMZN',  'Amazon',       'stock',  '#ff9900',    186.24000000, 0, 0, 0, 203),
  (24, 'GOOGL', 'Alphabet',     'stock',  '#4285f4',    172.35000000, 0, 0, 0, 204),
  (25, 'NVDA',  'NVIDIA',       'stock',  '#76b900',    124.30000000, 0, 0, 0, 205),
  (26, 'META',  'Meta Platforms','stock', '#0866ff',    563.70000000, 0, 0, 0, 206),
  (27, 'AMD',   'AMD',          'stock',  '#ed1c24',    168.72000000, 0, 0, 0, 207),
  (28, 'BABA',  'Alibaba',      'stock',  '#ff6a00',     88.51000000, 0, 0, 0, 208),
  (29, 'MMM',   '3M Company',   'stock',  '#ff0000',    164.35000000, 0, 0, 0, 209),
  (30, 'ADBE',  'Adobe',        'stock',  '#ff0000',    512.30000000, 0, 0, 0, 210);

-- The rest of the stocks the Investing picker lists, so the page matches the UI.
INSERT IGNORE INTO assets
  (id, symbol, name, type, icon_color, price_usd, is_depositable, is_withdrawable, is_cold_storage_enabled, sort_order) VALUES
  (31, 'ABT', 'Abbot Labs', 'stock', '#c7c7c7', 118.42, 0, 0, 0, 211),
  (32, 'AEMD', 'Aethlon Medical', 'stock', '#4285f4', 0.62, 0, 0, 0, 212),
  (33, 'APT', 'Alpha Pro Tech', 'stock', '#8a8f98', 5.43, 0, 0, 0, 213),
  (34, 'AMC', 'AMC Holdings', 'stock', '#e82127', 3.15, 0, 0, 0, 214),
  (35, 'AXP', 'American Express', 'stock', '#ff9900', 238.61, 0, 0, 0, 215),
  (36, 'AIG', 'American International Group', 'stock', '#34a853', 78.93, 0, 0, 0, 216),
  (37, 'AMT', 'American Tower', 'stock', '#7b61ff', 196.44, 0, 0, 0, 217),
  (38, 'ADI', 'Analog Devices', 'stock', '#00a1e0', 214.8, 0, 0, 0, 218),
  (39, 'ASML', 'ASML', 'stock', '#c7c7c7', 742.6, 0, 0, 0, 219),
  (40, 'T', 'At&t', 'stock', '#4285f4', 22.41, 0, 0, 0, 220),
  (41, 'ATER', 'Aterian Inc', 'stock', '#8a8f98', 1.85, 0, 0, 0, 221),
  (42, 'MO', 'Attria Group', 'stock', '#e82127', 47.22, 0, 0, 0, 222),
  (43, 'BIDU', 'Baidu Inc', 'stock', '#ff9900', 92.44, 0, 0, 0, 223),
  (44, 'BAC', 'Bank of America', 'stock', '#34a853', 42.63, 0, 0, 0, 224),
  (45, 'BA', 'Boeing', 'stock', '#7b61ff', 152.81, 0, 0, 0, 225),
  (46, 'BMY', 'Bristol Myers', 'stock', '#00a1e0', 52.42, 0, 0, 0, 226),
  (47, 'CEI', 'Camber Energy', 'stock', '#c7c7c7', 0.18, 0, 0, 0, 227),
  (48, 'CRDF', 'Cardiff Oncology Inc', 'stock', '#4285f4', 3.42, 0, 0, 0, 228),
  (49, 'CAT', 'Caterpillar', 'stock', '#8a8f98', 386.2, 0, 0, 0, 229),
  (50, 'CVX', 'Chevron', 'stock', '#e82127', 148.62, 0, 0, 0, 230),
  (51, 'CHWY', 'Chewy Inc', 'stock', '#ff9900', 26.41, 0, 0, 0, 231),
  (52, 'CSCO', 'Cisco', 'stock', '#34a853', 54.22, 0, 0, 0, 232),
  (53, 'C', 'Citigroup', 'stock', '#7b61ff', 68.44, 0, 0, 0, 233),
  (54, 'CCO', 'Clear Channel Outdoor', 'stock', '#00a1e0', 1.42, 0, 0, 0, 234),
  (55, 'KO', 'Coca Cola', 'stock', '#c7c7c7', 62.82, 0, 0, 0, 235),
  (56, 'CL', 'Colgate-Palmolive', 'stock', '#4285f4', 92.61, 0, 0, 0, 236),
  (57, 'CMCSA', 'Comcast', 'stock', '#8a8f98', 41.22, 0, 0, 0, 237),
  (58, 'COST', 'Costco', 'stock', '#e82127', 884.6, 0, 0, 0, 238),
  (59, 'DIS', 'Disney', 'stock', '#ff9900', 96.44, 0, 0, 0, 239),
  (60, 'EBAY', 'Ebay', 'stock', '#34a853', 62.41, 0, 0, 0, 240),
  (61, 'XOM', 'Exxon Mobil', 'stock', '#7b61ff', 116.83, 0, 0, 0, 241),
  (62, 'FSLY', 'Fastly Inc', 'stock', '#00a1e0', 8.41, 0, 0, 0, 242),
  (63, 'RACE', 'Ferrari', 'stock', '#c7c7c7', 428.62, 0, 0, 0, 243),
  (64, 'GE', 'General Electric', 'stock', '#4285f4', 186.42, 0, 0, 0, 244),
  (65, 'GM', 'General Motors', 'stock', '#8a8f98', 48.63, 0, 0, 0, 245),
  (66, 'GEVO', 'Gevo Inc', 'stock', '#e82127', 2.24, 0, 0, 0, 246),
  (67, 'GS', 'Goldman Sachs', 'stock', '#ff9900', 512.44, 0, 0, 0, 247),
  (68, 'HD', 'Home Depot', 'stock', '#34a853', 396.2, 0, 0, 0, 248),
  (69, 'HON', 'Honeywell', 'stock', '#7b61ff', 208.63, 0, 0, 0, 249),
  (70, 'IBM', 'IBM', 'stock', '#00a1e0', 224.81, 0, 0, 0, 250),
  (71, 'INMD', 'Inmode', 'stock', '#c7c7c7', 16.42, 0, 0, 0, 251),
  (72, 'INTC', 'Intel', 'stock', '#4285f4', 22.81, 0, 0, 0, 252),
  (73, 'JNJ', 'Johnson & Johnson', 'stock', '#8a8f98', 156.42, 0, 0, 0, 253),
  (74, 'JPM', 'JP Morgan', 'stock', '#e82127', 218.62, 0, 0, 0, 254),
  (75, 'LVS', 'Las Vegas Sands', 'stock', '#ff9900', 42.83, 0, 0, 0, 255),
  (76, 'LEN', 'Lennar Corporation', 'stock', '#34a853', 168.21, 0, 0, 0, 256),
  (77, 'MRIN', 'Marin Software', 'stock', '#7b61ff', 2.14, 0, 0, 0, 257),
  (78, 'MA', 'MasterCard', 'stock', '#00a1e0', 468.21, 0, 0, 0, 258),
  (79, 'MRK', 'Merck', 'stock', '#c7c7c7', 108.43, 0, 0, 0, 259),
  (80, 'FB', 'Meta Platforms Inc', 'stock', '#4285f4', 584.62, 0, 0, 0, 260),
  (81, 'MDLZ', 'Mondelez', 'stock', '#8a8f98', 68.42, 0, 0, 0, 261),
  (82, 'MNST', 'Monster', 'stock', '#e82127', 54.21, 0, 0, 0, 262),
  (83, 'MS', 'Morgan Stanley', 'stock', '#ff9900', 102.62, 0, 0, 0, 263),
  (84, 'MSI', 'Motorola', 'stock', '#34a853', 428.42, 0, 0, 0, 264),
  (85, 'NFLX', 'Netflix', 'stock', '#7b61ff', 728.62, 0, 0, 0, 265),
  (86, 'NKE', 'Nike', 'stock', '#00a1e0', 78.21, 0, 0, 0, 266),
  (87, 'NVS', 'Novartis', 'stock', '#c7c7c7', 104.62, 0, 0, 0, 267),
  (88, 'ORCL', 'Oracle', 'stock', '#4285f4', 172.83, 0, 0, 0, 268),
  (89, 'PYPL', 'Paypal', 'stock', '#8a8f98', 78.62, 0, 0, 0, 269),
  (90, 'PEP', 'Pepsico', 'stock', '#e82127', 168.42, 0, 0, 0, 270),
  (91, 'PFE', 'Pfizer', 'stock', '#ff9900', 28.62, 0, 0, 0, 271),
  (92, 'PG', 'Procter & Gamble', 'stock', '#34a853', 168.21, 0, 0, 0, 272),
  (93, 'RL', 'Ralph Lauren', 'stock', '#7b61ff', 186.42, 0, 0, 0, 273),
  (94, 'RWLK', 'ReWalk Robotics', 'stock', '#00a1e0', 0.84, 0, 0, 0, 274),
  (95, 'RKLB', 'Rocket Lab', 'stock', '#c7c7c7', 22.62, 0, 0, 0, 275),
  (96, 'CRM', 'Salesforce Inc', 'stock', '#4285f4', 284.62, 0, 0, 0, 276),
  (97, 'SNAP', 'Snap Inc', 'stock', '#8a8f98', 11.21, 0, 0, 0, 277),
  (98, 'SQ', 'Square', 'stock', '#e82127', 68.43, 0, 0, 0, 278),
  (99, 'SSRM', 'SSR Mining', 'stock', '#ff9900', 8.62, 0, 0, 0, 279),
  (100, 'SBUX', 'Starbucks', 'stock', '#34a853', 96.42, 0, 0, 0, 280),
  (101, 'TMUS', 'T-Mobile', 'stock', '#7b61ff', 208.42, 0, 0, 0, 281),
  (102, 'TEVA', 'Teva', 'stock', '#00a1e0', 16.81, 0, 0, 0, 282),
  (103, 'TM', 'Toyota Motor', 'stock', '#c7c7c7', 178.42, 0, 0, 0, 283),
  (104, 'TRIP', 'TripAdvisor', 'stock', '#4285f4', 16.23, 0, 0, 0, 284),
  (105, 'TSM', 'TSMC', 'stock', '#8a8f98', 186.42, 0, 0, 0, 285),
  (106, 'TWTR', 'Twitter', 'stock', '#e82127', 53.71, 0, 0, 0, 286),
  (107, 'UNH', 'United Health Group', 'stock', '#ff9900', 568.21, 0, 0, 0, 287),
  (108, 'VZ', 'Verizon', 'stock', '#34a853', 42.62, 0, 0, 0, 288),
  (109, 'V', 'Visa', 'stock', '#7b61ff', 286.42, 0, 0, 0, 289),
  (110, 'WMT', 'Walmart', 'stock', '#00a1e0', 82.63, 0, 0, 0, 290),
  (111, 'WFC', 'Wells Fargo', 'stock', '#c7c7c7', 62.41, 0, 0, 0, 291);
-- The rest of the Markets and Trade universe: crypto, fiat and commodities.
INSERT IGNORE INTO assets
  (id, symbol, name, type, icon_color, price_usd, is_active, is_depositable, is_withdrawable, is_cold_storage_enabled, sort_order) VALUES
  (112, 'AAVE', 'AAVE', 'crypto', '#f7931a', 148.3995, 1, 0, 0, 0, 20),
  (113, 'ALGO', 'Algorand', 'crypto', '#8247e5', 0.1088, 1, 0, 0, 0, 21),
  (114, 'ALU', 'Aluminum', 'commodity', '#8b5cf6', 2989.60, 1, 0, 0, 0, 400),
  (115, 'ANC', 'Anchor Protocol', 'crypto', '#627eea', 0.0035, 1, 0, 0, 0, 22),
  (116, 'APE', 'ApeCoin', 'crypto', '#8b5cf6', 0.1343, 1, 0, 0, 0, 23),
  (117, 'AURORA', 'Aurora', 'crypto', '#f59e0b', 0.0488, 1, 0, 0, 0, 24),
  (118, 'AXS', 'Axie Infinity', 'crypto', '#14b8a6', 1.0203, 1, 0, 0, 0, 25),
  (119, 'BCH', 'Bitcoin Cash', 'crypto', '#8247e5', 263.3123, 1, 0, 0, 0, 26),
  (120, 'BORING', 'Boring DAO', 'crypto', '#a855f7', 0.0003, 1, 0, 0, 0, 27),
  (121, 'BSV', 'Bitcoin SV', 'crypto', '#0ea5e9', 17.907, 1, 0, 0, 0, 28),
  (122, 'BTG', 'Bitcoin Gold', 'crypto', '#a855f7', 0.5857, 1, 0, 0, 0, 29),
  (123, 'COCOA', 'Cocoa', 'commodity', '#22c55e', 5892.00, 1, 0, 0, 0, 401),
  (124, 'COFFEE', 'Coffee', 'commodity', '#627eea', 305.60, 1, 0, 0, 0, 402),
  (125, 'CORN', 'Corn', 'commodity', '#22c55e', 465.77, 1, 0, 0, 0, 403),
  (126, 'COTTON', 'Cotton', 'commodity', '#a855f7', 8242.00, 1, 0, 0, 0, 404),
  (127, 'CRO', 'Cronos', 'crypto', '#8b5cf6', 0.056, 1, 0, 0, 0, 30),
  (128, 'DAI', 'Dai', 'crypto', '#627eea', 1.0014, 1, 0, 0, 0, 31),
  (129, 'DASH', 'Dash', 'crypto', '#64748b', 46.9773, 1, 0, 0, 0, 32),
  (130, 'ETC', 'Ethereum Classic', 'crypto', '#0ea5e9', 7.6975, 1, 0, 0, 0, 33),
  (131, 'EVMOS', 'Evmos', 'crypto', '#0ea5e9', 0.0019, 1, 0, 0, 0, 34),
  (132, 'FET', 'Artificial Superintelligence Alliance', 'crypto', '#e11d48', 0.1931, 1, 0, 0, 0, 35),
  (133, 'GASOLINE', 'Gasoline', 'commodity', '#ef4444', 3.1335, 1, 0, 0, 0, 405),
  (134, 'GMT', 'Stepn', 'crypto', '#f7931a', 0.0075, 1, 0, 0, 0, 36),
  (135, 'GRT', 'The Graph', 'crypto', '#ef4444', 0.0237, 1, 0, 0, 0, 37),
  (136, 'GT', 'Gate Token', 'crypto', '#14b8a6', 10.0982, 1, 0, 0, 0, 38),
  (137, 'HBAR', 'Hedera', 'crypto', '#f59e0b', 0.0811, 1, 0, 0, 0, 39),
  (138, 'HEX', 'Hex', 'crypto', '#22c55e', 0.0005, 1, 0, 0, 0, 40),
  (139, 'ICP', 'Internet Computer', 'crypto', '#ef4444', 2.889, 1, 0, 0, 0, 41),
  (140, 'INR', 'Indian Rupee', 'fiat', '#8b5cf6', 95.1503, 1, 0, 0, 0, 100),
  (141, 'LEAD', 'Lead', 'commodity', '#64748b', 1880.60, 1, 0, 0, 0, 406),
  (142, 'LN', 'Link', 'crypto', '#22c55e', 0.0213, 1, 0, 0, 0, 42),
  (143, 'LUMBER', 'Lumber', 'commodity', '#a855f7', 569.94, 1, 0, 0, 0, 407),
  (144, 'MANA', 'Decentraland', 'crypto', '#8247e5', 0.0842, 1, 0, 0, 0, 43),
  (145, 'NATURALGAS', 'Natural Gas', 'commodity', '#0ea5e9', 3.5008, 1, 0, 0, 0, 408),
  (146, 'NEXO', 'Nexo', 'crypto', '#8247e5', 0.804, 1, 0, 0, 0, 44),
  (147, 'NI', 'Nickel', 'commodity', '#8b5cf6', 15229.00, 1, 0, 0, 0, 409),
  (148, 'OATS', 'Oats', 'commodity', '#e11d48', 305.00, 1, 0, 0, 0, 410),
  (149, 'OGN', 'Origin Protocol', 'crypto', '#f7931a', 0.0305, 1, 0, 0, 0, 45),
  (150, 'OIL', 'Oil', 'commodity', '#f7931a', 94.71, 1, 0, 0, 0, 411),
  (151, 'OKB', 'OKB', 'crypto', '#e11d48', 115.1688, 1, 0, 0, 0, 46),
  (152, 'OP', 'Optimism', 'crypto', '#0ea5e9', 0.1304, 1, 0, 0, 0, 47),
  (153, 'ORANGEJUICE', 'Orange Juice', 'commodity', '#22c55e', 144.319, 1, 0, 0, 0, 412),
  (154, 'ORN', 'Orion Protocol', 'crypto', '#8b5cf6', 1.0716, 1, 0, 0, 0, 48),
  (155, 'PEPE', 'Pepe', 'crypto', '#a855f7', 0.00, 1, 0, 0, 0, 49),
  (156, 'PNG', 'Pangolin', 'crypto', '#f59e0b', 0.0284, 1, 0, 0, 0, 50),
  (157, 'QNT', 'Quant', 'crypto', '#0ea5e9', 34.54, 1, 0, 0, 0, 51),
  (158, 'RARI', 'Rarible', 'crypto', '#0ea5e9', 0.1418, 1, 0, 0, 0, 52),
  (159, 'RNDR', 'Render', 'crypto', '#14b8a6', 3.6904, 1, 0, 0, 0, 53),
  (160, 'RUB', 'Russian Ruble', 'fiat', '#8247e5', 83.8067, 1, 0, 0, 0, 101),
  (161, 'SFP', 'Safepal', 'crypto', '#0ea5e9', 0.2509, 1, 0, 0, 0, 54),
  (162, 'SHIB', 'Shiba Inu', 'crypto', '#a855f7', 0.00, 1, 0, 0, 0, 55),
  (163, 'SOLO', 'Sologenic', 'crypto', '#64748b', 0.8569, 1, 0, 0, 0, 56),
  (164, 'SOYBEAN', 'Soybean', 'commodity', '#8b5cf6', 1284.30, 1, 0, 0, 0, 413),
  (165, 'SUGAR', 'Sugar', 'commodity', '#64748b', 20.062, 1, 0, 0, 0, 414),
  (166, 'SUSHI', 'Sushi', 'crypto', '#627eea', 0.2159, 1, 0, 0, 0, 57),
  (167, 'TLOS', 'Telos', 'crypto', '#a855f7', 0.0169, 1, 0, 0, 0, 58),
  (168, 'TON', 'Toncoin', 'crypto', '#22c55e', 0.3692, 1, 0, 0, 0, 59),
  (169, 'UNI', 'Uniswap', 'crypto', '#22c55e', 6.8645, 1, 0, 0, 0, 60),
  (170, 'VELO', 'Velo', 'crypto', '#f7931a', 0.0363, 1, 0, 0, 0, 61),
  (171, 'VET', 'Vechain', 'crypto', '#e11d48', 0.0067, 1, 0, 0, 0, 62),
  (172, 'WHEAT', 'Wheat', 'commodity', '#14b8a6', 662.38, 1, 0, 0, 0, 415),
  (173, 'WING', 'Wing Finance', 'crypto', '#0ea5e9', 0.1366, 1, 0, 0, 0, 63),
  (174, 'XAG', 'Silver', 'commodity', '#f7931a', 56.8155, 1, 0, 0, 0, 416),
  (175, 'XAU', 'Gold', 'commodity', '#8247e5', 4157.255, 1, 0, 0, 0, 417),
  (176, 'XCN', 'Onyxcoin', 'crypto', '#64748b', 0.004, 1, 0, 0, 0, 64),
  (177, 'XCU', 'Copper', 'commodity', '#e11d48', 6.5989, 1, 0, 0, 0, 418),
  (178, 'XDC', 'XDC Network', 'crypto', '#e11d48', 0.0346, 1, 0, 0, 0, 65),
  (179, 'XMR', 'Monero', 'crypto', '#ef4444', 379.00, 1, 0, 0, 0, 66),
  (180, 'XPD', 'Palladium', 'commodity', '#8b5cf6', 1122.562, 1, 0, 0, 0, 419),
  (181, 'XPR', 'Proton', 'crypto', '#0ea5e9', 0.0022, 1, 0, 0, 0, 67),
  (182, 'XPT', 'Platinum', 'commodity', '#64748b', 1617.22, 1, 0, 0, 0, 420),
  (183, 'XRPH', 'XRP Healthcare', 'crypto', '#a855f7', 0.0417, 1, 0, 0, 0, 68),
  (184, 'XTZ', 'Tezos', 'crypto', '#0ea5e9', 0.2967, 1, 0, 0, 0, 69),
  (185, 'ZAR', 'South African Rand', 'fiat', '#a855f7', 16.5559, 1, 0, 0, 0, 102),
  (186, 'ZEC', 'Zcash', 'crypto', '#f7931a', 1092.7227, 1, 0, 0, 0, 70),
  (187, 'ZNC', 'Zinc', 'commodity', '#8247e5', 3651.13, 1, 0, 0, 0, 421);

-- Deposit addresses are obvious placeholders; set real ones in the admin panel.
INSERT IGNORE INTO asset_networks (id, asset_id, network_id, deposit_address, minimum_deposit, withdrawal_fee) VALUES
  (1, 1,  1, 'bc1qexampleplaceholder00000000000000000000', 0.00100000, 0.00050000),
  (2, 2,  2, '0xE000000000000000000000000000000000000001',  0.01000000, 0.00500000),
  (3, 3,  3, 'TExample000000000000000000000000000',         10.00000000, 1.00000000),
  (4, 3,  2, '0xE000000000000000000000000000000000000003',  10.00000000, 5.00000000),
  (5, 4,  2, '0xE000000000000000000000000000000000000004',  10.00000000, 5.00000000),
  (6, 5,  4, '0xE000000000000000000000000000000000000005',  0.05000000, 0.01000000),
  (7, 6,  5, 'ExampleSolanaAddress00000000000000000000000', 0.50000000, 0.01000000),
  (8, 11, 6, '0xE000000000000000000000000000000000000011',  50.00000000, 1.00000000);

INSERT IGNORE INTO withdrawal_assets (id, asset_id, is_enabled, minimum, maximum, fee_percent, sort_order) VALUES
  (1, 1,  1, 0.00100000, 100.00000000, 1.00, 1),
  (2, 2,  1, 0.01000000, 1000.00000000, 1.00, 2),
  (3, 3,  1, 10.00000000, 1000000.00000000, 0.50, 3),
  (4, 4,  1, 10.00000000, 1000000.00000000, 0.50, 4),
  (5, 6,  1, 0.50000000, 5000.00000000, 1.00, 5),
  (6, 12, 0, 1.00000000, 1000.00000000, 1.00, 6);

-- ---------------------------------------------------------------------------
-- Products (Cards, Subscribe, Signals, Mining, Stake, Real estate, Copy trading)
-- ---------------------------------------------------------------------------

INSERT IGNORE INTO card_products (id, slug, name, card_type, kyc_required, issuance_fee, minimum_deposit, last4, sort_order) VALUES
  (1, 'regular-card',  'Regular Card',  'regular',  0, 1000.00, 'No minimum', '4291', 1),
  (2, 'virtual-card',  'Virtual Card',  'virtual',  1, 1000.00, '$10,000',    '5138', 2),
  (3, 'physical-card', 'Physical Card', 'physical', 1, 1000.00, '$50,000',    '7702', 3);

INSERT IGNORE INTO subscription_plans (id, slug, name, minimum, maximum, duration_days, roi_percent, sort_order) VALUES
  (1, 'starter', 'Starter plan',  11000.00,   49500.00, 3, 200.00, 1),
  (2, 'lite',    'Lite plan',     20000.00,   49500.00, 3, 300.00, 2),
  (3, 'classic', 'Classic plan',  50000.00,   99500.00, 3, 350.00, 3),
  (4, 'pro',     'Pro plan',     100000.00, 1000000.00, 3, 403.00, 4);

INSERT IGNORE INTO signal_products (id, slug, name, price, strength, sort_order) VALUES
  (1,  'cd-v5',              'CD V5',             1000.00,  30, 1),
  (2,  'r28-m',              'R28-M',             1500.00,  35, 2),
  (3,  'acd-pro',            'ACD-Pro',           2000.00,  45, 3),
  (4,  'cd-v5-pro',          'CD V5 Pro',         3000.00,  50, 4),
  (5,  'xpn-4n',             'XPN-4N',            5000.00,  65, 5),
  (6,  'bc-irs',             'BC-IRS',            7000.00,  75, 6),
  (7,  'bc-irs-level2-pro',  'BC-IRS LEVEL2 Pro',10000.00,  89, 7),
  (8,  'tasana-pro',         'TASANA Pro',       15000.00,  94, 8),
  (9,  'rbf-v6-25000',       'RBF V6 25000',     25000.00,  96, 9),
  (10, 'silver-pro',         'SILVER Pro',       35000.00,  98, 10),
  (11, 'wayxe-pro',          'WAYXE Pro',        50000.00, 100, 11);

INSERT IGNORE INTO mining_pools (id, asset_id, title, miner, duration_days, minimum, maximum, roi_percent, sort_order) VALUES
  (1, 1, 'Bitcoin Mining Pool', 'BitMiner', 1, 1.00, 10.00, 100.00, 1);

INSERT IGNORE INTO staking_pools (id, asset_id, title, cycle, duration_days, minimum, maximum, roi_percent, sort_order) VALUES
  (1, 12, 'Avalanche Pool', 'daily',  30, 9.00000000,    1000.00000000, 84.00, 1),
  (2, 2,  'Ethereum Pool',  'daily',  30, 1.00000000,      10.00000000, 62.00, 2),
  (3, 11, 'Polygon Pool',   'daily',  30, 40.00000000,    87.00000000, 55.00, 3),
  (4, 6,  'Solana Pool',    'daily',  30, 6.00000000,     18.00000000, 68.00, 4),
  (5, 3,  'Tether Pool',    'daily',  30, 5000.00000000, 50000.00000000, 41.00, 5);

INSERT IGNORE INTO real_estate_projects (id, slug, title, description, status, minimum, roi_percent, strategy, sort_order) VALUES
  (1,  'bridge-labs',           'Bridge Labs at Pegasus Park', 'Life science redevelopment within a thriving new biotech-focused campus in Dallas, recognized as one of the top emerging life science markets.', 'open', 12000.00, 85.00, 'Fixed income', 1),
  (2,  'go-store-it',           'Go Store It Nashville',       'Class A self-storage development in one of Nashville''s fastest growing suburbs with constrained supply and a high barrier to entry.', 'open', 15000.00, 75.00, 'Fixed income', 2),
  (3,  'fabian-labs',           'Fabian Labs, Palo Alto',      'Two-building life science conversion in the heart of Silicon Valley and minutes from Stanford University, one of the top U.S. research institutions.', 'open', 24000.00, 57.00, 'Growth & Income', 3),
  (4,  'palmetto',              'Palmetto Industrial Park',    'Acquisition of a newly constructed three-building industrial property, already garnering interest from prospective tenants.', 'open', 25000.00, 78.80, 'Fixed income', 4),
  (5,  'mirage',                'The Mirage - Texas State Student Housing', 'A Texas State University student housing acquisition assuming below-market fixed-rate debt, with a renovation and rebranding strategy.', 'open', 32500.00, 84.35, 'Growth & Income', 5),
  (6,  'hilton-philadelphia',   'Hilton Philadelphia City Avenue', 'Discounted acquisition of a recently renovated hotel property in Philadelphia with below-market, assumable debt.', 'open', 33000.00, 68.70, 'Growth & Income', 6),
  (7,  'wynhouse-miami',        'Wynhouse Miami',              'Amenity-rich, Class A multifamily development in the heart of Wynwood, one of Miami''s most sought-after neighborhoods.', 'closed', 14865.00, 33.00, 'Fixed income', 7),
  (8,  'forestview-crest',      'Forestview Crest Townhomes',  'Opportunistic acquisition of a newly constructed build-to-rent townhome community in suburban Charlotte.', 'closed', 15000.00, 43.00, 'Fixed income', 8),
  (9,  'andover-rd',            'Andover R&D Portfolio',       'Two fully leased flex R&D buildings located in Greater Boston''s technology corridor, targeting strong quarterly cash flow.', 'closed', 16000.00, 73.00, 'High income', 9),
  (10, 'novi-concord',          'Novi at Concord - Preferred Equity', 'Three luxury apartment buildings in advanced stages of development in downtown Concord, N.C.', 'closed', 17500.00, 53.00, 'Value-add', 10),
  (11, 'tesla-orlando',         'Tesla Build-to-Suit Orlando', 'Development of a custom-built dealership and service center for Tesla, a Fortune 100 company.', 'closed', 18733.00, 40.00, 'Fixed income', 11),
  (12, 'centra-nyc',            'Centra NYC',                  'Unique off-market recapitalization opportunity for a fully leased luxury apartment high-rise in Midtown Manhattan.', 'closed', 23500.00, 55.00, 'Fixed income', 12);

INSERT IGNORE INTO copy_experts (id, name, username, badge, followers, win_rate_percent, profit_share_percent, wins, losses, total_trades, minimum_startup, sort_order) VALUES
  (1, 'W D Gann',            'w_d_gann',            'gold',   94200, 58.52, 16.05,  896, 303, 4482,    0.00, 1),
  (2, 'Alertia Mars',        'alertia_mars',        'blue',   89200, 83.75, 17.55, 6543, 549, 2772,    0.00, 2),
  (3, 'Amadeus Crypto',      'amadeus_crypto',      'gold',   93700, 40.16, 99.88, 2108, 336, 4926,    0.00, 3),
  (4, 'Crypto Shark',        'crypto_shark',        'blue',   71600, 61.00, 53.36, 8176, 729, 3018,  500.00, 4),
  (5, 'Sebastian Rodriguez', 'sebastian_rodriguez_','gold',   40900, 85.87, 70.76, 2918, 575, 1475, 1500.00, 5),
  (6, 'Skyital Ltc',         'skyital_ltc',         'gold',   62800, 63.81, 49.84, 5291, 938, 1833, 3000.00, 6);

-- ---------------------------------------------------------------------------
-- Platform settings — one row per control in the Settings drawer
-- ---------------------------------------------------------------------------

INSERT IGNORE INTO settings (`key`, `value`, value_type, `group`, label) VALUES
  ('site_name',                    'Ororo Markets',         'string',  'general',    'Site name'),
  ('site_url',                     'http://localhost:5173', 'string',  'general',    'Site URL'),
  ('support_email',                'support@ororomarkets.test', 'string', 'general',  'Support email'),
  ('maintenance_mode',             '0',                     'bool',    'general',    'Maintenance mode'),
  ('allow_registration',           '1',                     'bool',    'general',    'Allow new registrations'),
  ('lock_verification',            '0',                     'bool',    'general',    'Lock accounts until verified'),
  ('email_verification_required',  '0',                     'bool',    'general',    'Require email verification'),
  ('default_currency',             'USD',                   'string',  'general',    'Default account currency'),
  ('minimum_password_length',      '6',                     'int',     'security',   'Minimum password length'),
  ('max_login_attempts',           '8',                     'int',     'security',   'Max login attempts'),
  ('session_lifetime_minutes',     '4320',                  'int',     'security',   'Session lifetime (minutes)'),
  ('two_factor_required',          '0',                     'bool',    'security',   'Force two-factor authentication'),
  ('allow_crypto_deposit',         '1',                     'bool',    'deposit',    'Allow crypto deposits'),
  ('allow_bank_deposit',           '1',                     'bool',    'deposit',    'Allow bank transfers'),
  ('show_assets',                  '1',                     'bool',    'deposit',    'Show every asset on Deposit'),
  ('deposit_instructions',         'Send only the asset shown for the selected network.', 'text', 'deposit', 'Deposit instructions'),
  ('allow_crypto_withdrawal',      '1',                     'bool',    'withdrawal', 'Allow users to withdraw crypto'),
  ('use_withdrawal_code',          '0',                     'bool',    'withdrawal', 'Require a withdrawal code'),
  ('withdrawal_code',              '',                      'string',  'withdrawal', 'Withdrawal code'),
  ('minimum_withdrawal',           '50.00',                 'decimal', 'withdrawal', 'Minimum withdrawal (USD)'),
  ('maximum_withdrawal',           '100000.00',             'decimal', 'withdrawal', 'Maximum withdrawal (USD)'),
  ('withdrawal_fee_percent',       '1.00',                  'decimal', 'withdrawal', 'Withdrawal fee (%)'),
  ('auto_approve_withdrawals',     '0',                     'bool',    'withdrawal', 'Auto-approve withdrawals'),
  ('default_theme',                'dark',                  'string',  'interface',  'Default theme'),
  ('default_accent_color',         '#31acee',               'color',   'interface',  'Default accent colour'),
  ('allow_user_theme_change',      '1',                     'bool',    'interface',  'Let users change theme and accent'),
  ('save_interface_for_all_users', '1',                     'bool',    'interface',  'Save interface choices for all users'),
  ('lock_experts_page',            '0',                     'bool',    'general',    'Lock the Copy experts page'),
  ('use_miner_pictures',           '1',                     'bool',    'mining',     'Use miner pictures'),
  ('mining_enabled',               '1',                     'bool',    'mining',     'Enable mining'),
  ('referral_enabled',             '1',                     'bool',    'referral',   'Enable the referral program'),
  ('use_referral_percentage',      '1',                     'bool',    'referral',   'Reward a percentage of deposits'),
  ('referral_percent',             '10.00',                 'decimal', 'referral',   'Referral reward (%)'),
  ('referral_amount',              '6000.00',               'decimal', 'referral',   'Referral reward per friend (USD)'),
  ('referral_minimum_deposit',     '100.00',                'decimal', 'referral',   'Minimum deposit to qualify'),
  ('allow_regular_card',           '1',                     'bool',    'cards',      'Allow regular cards'),
  ('allow_virtual_card',           '1',                     'bool',    'cards',      'Allow virtual cards'),
  ('allow_physical_card',          '1',                     'bool',    'cards',      'Allow physical cards'),
  ('card_kyc_required',            '1',                     'bool',    'cards',      'Require KYC for cards'),
  ('card_issuance_fee',            '1000.00',               'decimal', 'cards',      'Card issuance fee (USD)'),
  ('card_minimum_deposit',         '10000.00',              'decimal', 'cards',      'Card deposit minimum (USD)'),
  ('trading_enabled',              '1',                     'bool',    'trading',    'Enable trading'),
  ('default_leverage',             '1',                     'decimal', 'trading',    'Default leverage'),
  ('max_leverage',                 '100',                   'decimal', 'trading',    'Maximum leverage'),
  ('minimum_trade_amount',         '10.00',                 'decimal', 'trading',    'Minimum trade amount (USD)'),
  ('subscription_enabled',         '1',                     'bool',    'subscription','Enable subscription plans'),
  ('signals_enabled',              '1',                     'bool',    'subscription','Enable signal products');

-- ---------------------------------------------------------------------------
-- Demo accounts
--   Passwords are stored as typed (Account::HASH_PASSWORDS = false) so the demo
--   logins can be inspected in the database. Change them before going anywhere
--   near production.
-- ---------------------------------------------------------------------------

INSERT IGNORE INTO users
  (id, role_id, account_level_id, first_name, last_name, username, email, password_hash,
   country_code, phone_dial_code, phone, account_currency, referral_code, referred_by,
   email_verified_at, status, kyc_status)
VALUES
  (1, 1, 5, 'Ada',   'Ororo',  'admin', 'admin@ororomarkets.test',
   'Admin@123',
   'GB', '+44', '7700900001', 'USD', 'ADMINHOPER', NULL, NOW(), 'active', 'verified'),
  (2, 2, 3, 'John',  'Doe',    'johndoe', 'user@ororomarkets.test',
   'User@123',
   'US', '+1', '2025550002', 'USD', 'JOHNDOE123', 1, NOW(), 'active', 'verified'),
  (3, 2, 1, 'Maria', 'Klein',  'mariak', 'maria@ororomarkets.test',
   'User@123',
   'DE', '+49', '1512345678', 'EUR', 'MARIAKLEIN', 2, NULL, 'active', 'pending');

INSERT IGNORE INTO user_accounts (id, user_id, type, currency, balance) VALUES
  (1, 1, 'real',         'USD', 250000.00000000),
  (2, 1, 'demo',         'USD',      0.00000000),
  (3, 2, 'real',         'USD',  48250.50000000),
  (4, 2, 'demo',         'USD',      0.00000000),
  (5, 3, 'real',         'EUR',   1250.75000000),
  (6, 3, 'demo',         'EUR',      0.00000000),
  (7, 1, 'signal',       'USD',  25000.00000000),
  (8, 1, 'subscription', 'USD',  10000.00000000),
  (9, 1, 'profit',       'USD',      0.00000000),
  (10, 2, 'signal',      'USD',   6000.00000000),
  (11, 2, 'subscription','USD',   5000.00000000),
  (12, 2, 'profit',      'USD',   2318.42000000),
  (13, 3, 'signal',      'EUR',      0.00000000),
  (14, 3, 'subscription','EUR',      0.00000000),
  (15, 3, 'profit',      'EUR',      0.00000000);

INSERT IGNORE INTO referrals (id, referrer_id, referee_id, code, status) VALUES
  (1, 1, 2, 'ADMINHOPER', 'active'),
  (2, 2, 3, 'JOHNDOE123', 'active');

INSERT IGNORE INTO referral_claims (id, reference, user_id, amount, method, status, processed_by, processed_at) VALUES
  (1, 'CLM-20240001', 2, 6000.00, 'balance', 'paid', 1, NOW());

INSERT IGNORE INTO referral_earnings (id, user_id, referral_id, referee_id, source, source_id, base_amount, percent, amount, status, claim_id) VALUES
  (1, 2, 2, 3, 'deposit', 1, 60000.00, 10.00, 6000.00, 'claimed', 1),
  (2, 1, 1, 2, 'deposit', 2, 10000.00, 10.00, 1000.00, 'available', NULL);

INSERT IGNORE INTO asset_holdings (id, user_id, asset_id, location, amount, average_price_usd) VALUES
  (1, 2, 1, 'wallet',       0.75000000, 61000.00000000),
  (2, 2, 2, 'wallet',       4.25000000,  3100.00000000),
  (3, 2, 3, 'wallet',   15000.00000000,     1.00000000),
  (4, 2, 6, 'wallet',      60.00000000,   142.00000000),
  (5, 2, 1, 'cold_storage', 0.25000000, 58000.00000000),
  (6, 3, 3, 'wallet',     1250.75000000,     1.00000000);

INSERT IGNORE INTO stock_holdings (id, user_id, asset_id, quantity, average_price) VALUES
  (1, 2, 20, 3.25000000, 205.40000000),
  (2, 2, 21, 5.00000000, 231.10000000);

INSERT IGNORE INTO stock_orders (id, reference, user_id, asset_id, side, quantity, price, total_usd) VALUES
  (1, 'STK-20240001', 2, 20, 'buy', 3.25000000, 231.40000000,  752.05),
  (2, 'STK-20240002', 2, 21, 'buy', 5.00000000, 248.50000000, 1242.50);

INSERT IGNORE INTO deposits
  (id, reference, user_id, account_id, asset_id, network_id, method, deposit_type, amount, rate_usd, amount_usd, address, status, reviewed_by, reviewed_at) VALUES
  (1, 'DEP-20240001', 3, 5, 3, 3, 'crypto', 'regular', 1250.75000000, 1.00000000, 1250.75,
   'TExample000000000000000000000000000', 'approved', 1, NOW()),
  (2, 'DEP-20240002', 2, 3, 1, 1, 'crypto', 'regular', 0.15000000, 66500.00000000, 9975.00,
   'bc1qexampleplaceholder00000000000000000000', 'approved', 1, NOW()),
  (3, 'DEP-20240003', 2, 3, 3, 2, 'crypto', 'signal_fund', 5000.00000000, 1.00000000, 5000.00,
   '0xE000000000000000000000000000000000000003', 'pending', NULL, NULL);

INSERT IGNORE INTO payment_methods (id, user_id, type, label, details, is_default) VALUES
  (1, 2, 'bank', 'Chase ****4021', '{"holder":"John Doe","bank":"Chase","account":"****4021"}', 1),
  (2, 2, 'crypto', 'USDT TRC20', '{"address":"TExample000000000000000000000000000","network":"TRC20"}', 1);

INSERT IGNORE INTO withdrawals
  (id, reference, user_id, account_id, asset_id, network_id, payment_method_id, method, destination, amount, fee, amount_usd, status, reviewed_by, reviewed_at) VALUES
  (1, 'WDR-20240001', 2, 3, 3, 3, 2, 'crypto', 'TExample000000000000000000000000000', 2500.00000000, 1.00000000, 2500.00, 'approved', 1, NOW()),
  (2, 'WDR-20240002', 2, 3, NULL, NULL, 1, 'bank_transfer', 'Chase ****4021', 1000.00000000, 10.00000000, 1000.00, 'pending', NULL, NULL),
  (3, 'WDR-20240003', 3, 5, 3, 3, NULL, 'referral', 'Referral balance', 500.00000000, 0.00000000, 500.00, 'declined', 1, NOW());

INSERT IGNORE INTO transactions
  (id, user_id, account_id, asset_id, type, direction, amount, amount_usd, balance_after, status, reference, description) VALUES
  (1, 2, 3, 1, 'deposit',        'credit', 0.15000000,  9975.00, 9975.00000000, 'completed', 'DEP-20240002', 'Bitcoin deposit'),
  (2, 2, 3, 3, 'deposit',        'credit', 5000.00000000, 5000.00, 14975.00000000, 'pending',  'DEP-20240003', 'Signal fund deposit'),
  (3, 2, 3, 3, 'withdrawal',     'debit',  2500.00000000, 2500.00, 12475.00000000, 'completed', 'WDR-20240001', 'Withdrawal to USDT TRC20'),
  (4, 2, 3, 1, 'trade',          'debit',  0.75000000,  45750.00, 58225.00000000, 'completed', NULL, 'Spot buy BTC/USDT'),
  (5, 2, 3, NULL, 'subscription_fund', 'debit', 11000.00000000, 11000.00, 47225.00000000, 'completed', 'SUB-20240001', 'Starter plan'),
  (6, 2, 3, NULL, 'referral',    'credit', 1000.00000000, 1000.00, 48225.00000000, 'completed', NULL, 'Referral reward'),
  (7, 2, 3, 1, 'cold_storage_in','debit',  0.25000000,  16800.00, 31425.00000000, 'completed', NULL, 'Moved to cold storage'),
  (8, 1, 1, NULL, 'adjustment',  'credit', 250000.00000000, 250000.00, 250000.00000000, 'completed', NULL, 'Opening balance'),
  (9, 3, 5, 3, 'deposit',        'credit', 1250.75000000, 1250.75, 1250.75000000, 'completed', 'DEP-20240001', 'Tether deposit');

INSERT IGNORE INTO verifications
  (id, user_id, document_type, document_number, country_code, document_front_path, selfie_path, status, reviewed_by, reviewed_at) VALUES
  (1, 2, 'passport', 'P0000002', 'US', 'uploads/kyc/john-passport.jpg', 'uploads/kyc/john-selfie.jpg', 'verified', 1, NOW()),
  (2, 3, 'id_card',  'ID000003', 'DE', 'uploads/kyc/maria-id.jpg', 'uploads/kyc/maria-selfie.jpg', 'pending', NULL, NULL);

INSERT IGNORE INTO subscriptions (id, reference, user_id, plan_id, amount, payout_amount, status, started_at, matures_at) VALUES
  (1, 'SUB-20240001', 2, 1, 11000.00, 33000.00, 'active', NOW(), DATE_ADD(NOW(), INTERVAL 3 DAY));

INSERT IGNORE INTO signal_subscriptions (id, reference, user_id, signal_product_id, price, strength, status, purchased_at, expires_at) VALUES
  (1, 'SIG-20240001', 2, 6, 7000.00, 75, 'active', NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY));

INSERT IGNORE INTO signals (id, signal_product_id, asset_id, pair, direction, strength, entry_price, take_profit, stop_loss, result, published_at) VALUES
  (1, 6, 1, 'BTC/USDT', 'buy',  75, 67250.00000000, 71500.00000000, 64800.00000000, 'win',     NOW()),
  (2, 7, 2, 'ETH/USDT', 'sell', 89,  3512.40000000,  3280.00000000,  3620.00000000, 'pending', NOW());

INSERT IGNORE INTO mining_orders (id, reference, user_id, mining_pool_id, amount, payout_amount, status, started_at, ends_at) VALUES
  (1, 'MIN-20240001', 2, 1, 5.00, 10.00, 'active', NOW(), DATE_ADD(NOW(), INTERVAL 1 DAY));

INSERT IGNORE INTO stakes (id, reference, user_id, staking_pool_id, asset_id, amount, reward_amount, status, started_at, ends_at) VALUES
  (1, 'STK-STK-20240001', 2, 2,  2, 2.00000000, 1.24000000, 'active', NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY)),
  (2, 'STK-STK-20240002', 2, 4,  6, 12.00000000, 8.16000000, 'active', NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY)),
  (3, 'STK-STK-20240003', 3, 1, 12, 9.00000000, 7.56000000, 'closed', DATE_SUB(NOW(), INTERVAL 60 DAY), DATE_SUB(NOW(), INTERVAL 30 DAY));

INSERT IGNORE INTO real_estate_investments (id, reference, user_id, project_id, amount, payout_amount, duration_days, status) VALUES
  (1, 'REI-20240001', 2, 1, 12000.00, 22200.00, 365, 'active'),
  (2, 'REI-20240002', 2, 5, 32500.00, 59910.00, 365, 'active');

INSERT IGNORE INTO copy_subscriptions (id, reference, user_id, copy_expert_id, amount, status) VALUES
  (1, 'CPY-20240001', 2, 1, 2500.00, 'copying');

INSERT IGNORE INTO trade_orders
  (id, user_id, account_id, asset_id, market, side, mode, amount, leverage, duration_seconds, entry_price, profit_loss, result, status, opened_at, closed_at) VALUES
  (1, 2, 3, 1, 'crypto', 'buy',  'manual', 500.00000000, 1.00, 300, 66800.00000000,  135.00000000, 'win',  'closed', DATE_SUB(NOW(), INTERVAL 2 DAY), DATE_SUB(NOW(), INTERVAL 2 DAY)),
  (2, 2, 3, 2, 'crypto', 'sell', 'manual', 250.00000000, 5.00, 600,  3540.00000000, -120.00000000, 'loss', 'closed', DATE_SUB(NOW(), INTERVAL 1 DAY), DATE_SUB(NOW(), INTERVAL 1 DAY)),
  (3, 2, 3, 6, 'crypto', 'buy',  'auto',   300.00000000, 2.00, 900,   165.00000000,    0.00000000, NULL,   'open',   NOW(), NULL);

INSERT IGNORE INTO card_requests (id, user_id, card_product_id, holder_name, status, reviewed_by, reviewed_at) VALUES
  (1, 2, 2, 'John Doe', 'approved', 1, NOW());

INSERT IGNORE INTO user_cards (id, user_id, card_product_id, card_request_id, holder_name, last4, expiry_month, expiry_year, balance_usd, status, issued_at) VALUES
  (1, 2, 2, 1, 'John Doe', '5138', 11, 2028, 500.00, 'active', NOW());

INSERT IGNORE INTO wallet_connections (id, user_id, provider, wallet_address, chain, status, connected_at) VALUES
  (1, 2, 'Metamask', '0xExamplesUserWalletAddress0000000000000001', 'Ethereum', 'connected', NOW()),
  (2, 2, 'Coinbase', NULL, NULL, 'disconnected', NULL);

INSERT IGNORE INTO watchlist (id, user_id, asset_id) VALUES
  (1, 2, 1),
  (2, 2, 2),
  (3, 2, 20),
  (4, 3, 3);

INSERT IGNORE INTO notifications (id, user_id, title, body, type, is_broadcast, created_by, read_at) VALUES
  (1, 2, 'Deposit approved', 'Your Bitcoin deposit of 0.15000000 BTC has been approved.', 'transaction', 0, 1, NULL),
  (2, 2, 'Withdrawal request received', 'Your withdrawal of 1,000.00 USD is under review.', 'transaction', 0, 1, NULL),
  (3, 3, 'Verification received', 'Your documents are being reviewed.', 'verification', 0, 1, NULL),
  (4, NULL, 'Welcome to Ororo Markets', 'Explore markets, copy trading and real-estate projects.', 'promo', 1, 1, NULL);

INSERT IGNORE INTO content_blocks (id, slug, section, title, body, sort_order) VALUES
  (1, 'deposit-how-it-works',      'deposit',     'How deposits work',
   'Pick an asset and network, send the exact amount to the address shown, then submit the transaction hash. An administrator approves the deposit before it lands in your balance.', 1),
  (2, 'withdrawal-how-it-works',   'withdrawal',  'How withdrawals work',
   'Choose a saved payout method, enter the amount and submit the request. Requests stay pending until an administrator approves them; declined requests release the held funds.', 1),
  (3, 'verification-how-it-works', 'verification','Verification',
   'Upload a government-issued document and a selfie. Verification is required for virtual and physical cards and for higher withdrawal limits.', 1),
  (4, 'cold-storage-how-it-works', 'cold_storage','How cold storage works',
   'Move assets into cold storage to hold them off the trading wallet. Cold-storage balances still count towards your portfolio value.', 1),
  (5, 'referral-terms',            'referrals',   'Referral rewards',
   'Share your referral code. Rewards accrue when a referred friend funds their account, and can be claimed from the Referrals drawer once available.', 1);

-- ---------------------------------------------------------------------------
-- Audit trail
-- ---------------------------------------------------------------------------

INSERT IGNORE INTO admin_activity_log (id, admin_id, action, entity_type, entity_id, changes) VALUES
  (1, 1, 'deposit.approve',      'deposits',  2, '{"status":{"from":"pending","to":"approved"}}'),
  (2, 1, 'withdrawal.approve',   'withdrawals', 1, '{"status":{"from":"pending","to":"approved"}}'),
  (3, 1, 'verification.approve', 'verifications', 1, '{"status":{"from":"pending","to":"verified"}}'),
  (4, 1, 'settings.update',      'settings', NULL, '{"default_theme":{"from":"dark","to":"dark"}}');

-- ---------------------------------------------------------------------------
-- Account-level upgrade requests (member asks, admin approves)
-- ---------------------------------------------------------------------------
INSERT IGNORE INTO level_requests (id, user_id, level_id, balance_at_request, status, note, created_at) VALUES
  (1, 3, 2, 1250.75, 'pending', 'Balance covers the Silver minimum', NOW());