-- Seed data for NexPanel users (test data)
USE nexpanel;

-- Insert users with explicit IDs so parent-child relations work
INSERT INTO users (id, username, password_hash, role_id, parent_id, display_name, email, phone, avatar, status, wallet_balance, created_at)
VALUES
  (1, 'superadmin', SHA2('SuperSecurePass123!',256), 1, NULL, 'Super Admin', 'admin@example.local', '+10000000001', NULL, 'active', 1000.00, NOW()),
  (2, 'reseller1', SHA2('ResellerPass123!',256), 2, 1, 'Primary Reseller', 'reseller1@example.local', '+10000000002', NULL, 'active', 500.00, NOW()),
  (3, 'subreseller1', SHA2('SubResellerPass123!',256), 3, 2, 'Sub Reseller', 'sub1@example.local', '+10000000003', NULL, 'active', 200.00, NOW()),
  (4, 'customer1', SHA2('CustomerPass123!',256), 4, 2, 'Test Customer', 'customer1@example.local', '+10000000004', NULL, 'active', 50.00, NOW()),
  (5, 'marketer1', SHA2('MarketerPass123!',256), 5, 1, 'Marketer', 'marketer1@example.local', '+10000000005', NULL, 'active', 25.00, NOW())
ON DUPLICATE KEY UPDATE username=VALUES(username);

-- Note: Passwords are stored as SHA2 hashes here for seeding only.
-- Adjust password hashing to match your application's auth implementation before using these users for login.
