-- 20260416_03_seed_platform_admin.sql
-- Idempotent platform admin row (matches application bootstrap user id used in session resolution).

INSERT INTO employees (
  id,
  first_name,
  last_name,
  email,
  phone,
  address_street,
  address_city,
  address_state,
  address_zip,
  formatted_address,
  role_id,
  manager_id,
  status,
  assigned_site_ids,
  region,
  created_at,
  updated_at
)
VALUES (
  'USR-SEED-ADMIN',
  'Admin',
  'User',
  'admin@campsitems.com',
  '555-100-2000',
  '101 Admin Lane',
  'Tampa',
  'FL',
  '33601',
  '101 Admin Lane, Tampa, FL 33601',
  'ROLE-SUPER-ADMIN',
  NULL,
  'active',
  JSON_ARRAY(),
  NULL,
  CURRENT_TIMESTAMP,
  CURRENT_TIMESTAMP
)
ON DUPLICATE KEY UPDATE
  first_name = VALUES(first_name),
  last_name = VALUES(last_name),
  email = VALUES(email),
  phone = VALUES(phone),
  address_street = VALUES(address_street),
  address_city = VALUES(address_city),
  address_state = VALUES(address_state),
  address_zip = VALUES(address_zip),
  formatted_address = VALUES(formatted_address),
  role_id = VALUES(role_id),
  status = VALUES(status),
  assigned_site_ids = VALUES(assigned_site_ids),
  updated_at = CURRENT_TIMESTAMP;
