INSERT INTO companies (id, name, slug, email, phone, country, timezone, status, created_at, updated_at)
VALUES (1, 'TekiSOFT Demo Tenant', 'tekisoft-demo', 'admin@tekisoft.test', '255788839278', 'Tanzania', 'Africa/Dar_es_Salaam', 'active', NOW(), NOW());

INSERT INTO plans (id, name, code, router_limit, price_monthly, price_yearly, features_json, status, created_at, updated_at)
VALUES (1, 'Business', 'business', 25, 150000.00, 1500000.00, JSON_OBJECT('backups', true, 'alerts', true, 'remote_access', true), 'active', NOW(), NOW());

INSERT INTO subscriptions (id, company_id, plan_id, starts_at, ends_at, status, billing_cycle, router_limit, created_at, updated_at)
VALUES (1, 1, 1, NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY), 'active', 'monthly', 25, NOW(), NOW());

INSERT INTO router_groups (id, company_id, name, description, created_at, updated_at)
VALUES (1, 1, 'Main Sites', 'Primary branch routers', NOW(), NOW());

INSERT INTO router_tunnels (router_id, tunnel_type, tunnel_ip, public_key, status, connected_at, last_handshake_at, server_node, created_at, updated_at)
VALUES
(1,'wireguard','10.200.0.11','PUBKEY1','connected',NOW(),NOW(),'node-1',NOW(),NOW()),
(2,'wireguard','10.200.0.12','PUBKEY2','connected',NOW(),NOW(),'node-1',NOW(),NOW()),
(3,'wireguard','10.200.0.13','PUBKEY3','pending',NULL,NULL,'node-1',NOW(),NOW());

INSERT INTO router_metrics (router_id, cpu_usage, memory_usage, disk_usage, uptime_seconds, temperature, rx_bps, tx_bps, hotspot_users, pppoe_users, latency_ms, packet_loss, recorded_at)
VALUES
(1,25,40,30,120000,44,12000000,8000000,90,10,7,0,NOW()),
(2,32,46,28,130000,46,18000000,9000000,120,12,9,1,NOW()),
(3,0,0,0,0,0,0,0,0,0,0,0,DATE_SUB(NOW(), INTERVAL 20 MINUTE));

INSERT INTO router_backups (router_id, type, filename, storage_path, status, size_bytes, created_by, created_at, updated_at)
VALUES
(1,'binary','demo-1.backup','router-backups/1/demo-1.backup','success',20480,1,NOW(),NOW()),
(2,'binary','demo-2.backup','router-backups/2/demo-2.backup','success',20480,1,NOW(),NOW());

INSERT INTO router_alerts (company_id, router_id, severity, type, title, message, status, triggered_at, created_at, updated_at)
VALUES
(1,3,'critical','offline','Router offline','Branch Router 3 is offline.','open',DATE_SUB(NOW(), INTERVAL 15 MINUTE),NOW(),NOW());

INSERT INTO payments (company_id, subscription_id, amount, currency, method, reference, status, paid_at, created_at, updated_at)
VALUES
(1,1,150000.00,'TZS','M-Pesa','PAY-DEMO-001','paid',DATE_SUB(NOW(), INTERVAL 2 DAY),NOW(),NOW());

INSERT INTO invoices (company_id, subscription_id, invoice_no, amount, currency, due_date, status, created_at, updated_at)
VALUES
(1,1,'INV-2026-0001',150000.00,'TZS',DATE_ADD(CURDATE(), INTERVAL 7 DAY),'unpaid',NOW(),NOW());
