-- Seed: Platform Owner / PA (single bootstrap account)
--
-- email:    superadmin@neverland.education
-- password: neverland  (stored as bcrypt hash below — not used in app code)
-- role:     owner
-- name:     Super Admin
--
-- bcrypt hash (cost 10) for password "neverland":
--   $2b$10$VqFC6g.kdpVZxKUrAXloi.H/iKl0nfXDTV.eR1YeKogK1RNO2hurq
--
-- Run:
--   npm run seed:auth

INSERT INTO users (email, password_hash, full_name, role, school_id, is_active)
VALUES (
  'superadmin@neverland.education',
  '$2b$10$VqFC6g.kdpVZxKUrAXloi.H/iKl0nfXDTV.eR1YeKogK1RNO2hurq',
  'Super Admin',
  'owner',
  NULL,
  TRUE
)
ON CONFLICT (email) DO UPDATE SET
  password_hash = EXCLUDED.password_hash,
  full_name = EXCLUDED.full_name,
  role = EXCLUDED.role,
  school_id = EXCLUDED.school_id,
  is_active = TRUE,
  updated_at = NOW();
