-- ============================================
-- Create Admin User via SQL (for phpMyAdmin)
-- ============================================
-- 
-- INSTRUCTIONS:
-- 1. Generate a bcrypt hash for your password at: https://bcrypt-generator.com/
--    - Set rounds to 10
--    - Enter your desired password
--    - Copy the generated hash
-- 
-- 2. Replace the values below:
--    - 'Admin User' → Admin's full name
--    - 'admin@yourdomain.com' → Admin's email (must be unique)
--    - '$2a$10$YOUR_HASH_HERE' → Paste the bcrypt hash from step 1
--    - '+1234567890' → Admin's phone number
--
-- 3. Copy this entire SQL and paste into phpMyAdmin SQL tab
-- 4. Click "Go" to execute
--
-- ============================================

INSERT INTO `users` (
  `name`, 
  `email`, 
  `password`, 
  `contactNumber`, 
  `role`, 
  `isActive`, 
  `passwordSet`, 
  `createdAt`, 
  `updatedAt`
) VALUES (
  'Admin User',                    -- ⬅️ CHANGE: Admin's full name
  'admin@yourdomain.com',         -- ⬅️ CHANGE: Admin's email (must be unique)
  '$2a$10$YOUR_BCRYPT_HASH_HERE', -- ⬅️ CHANGE: Paste bcrypt hash here
  '+1234567890',                  -- ⬅️ CHANGE: Admin's phone number
  'admin',                        -- Keep as 'admin'
  TRUE,                           -- Keep as TRUE (active)
  TRUE,                           -- Keep as TRUE (password is set)
  NOW(),                          -- Current timestamp
  NOW()                           -- Current timestamp
);

-- ============================================
-- EXAMPLE: Default Admin (password: admin123)
-- ============================================
-- Uncomment and use this if you want a quick default admin:
-- 
-- INSERT INTO `users` (
--   `name`, 
--   `email`, 
--   `password`, 
--   `contactNumber`, 
--   `role`, 
--   `isActive`, 
--   `passwordSet`, 
--   `createdAt`, 
--   `updatedAt`
-- ) VALUES (
--   'Admin User',
--   'admin@example.com',
--   '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy',
--   '+1234567890',
--   'admin',
--   TRUE,
--   TRUE,
--   NOW(),
--   NOW()
-- );
--
-- ⚠️ WARNING: Change password immediately after first login!
-- ============================================
