-- Run this in phpMyAdmin after uploading /api to seed your organization, event, and staff.
-- Calling /api/auth/request-code.php once will also auto-create these tables if they don't exist yet.

INSERT INTO phantom_organizations (name, slug, status)
VALUES ('Socially Speaking', 'socially-speaking', 'active')
ON DUPLICATE KEY UPDATE name = VALUES(name);

INSERT INTO phantom_events (organization_id, name, event_key, status)
SELECT id, 'Socially Speaking Conference 2026', 'ssc-2026', 'active'
FROM phantom_organizations
WHERE slug = 'socially-speaking'
ON DUPLICATE KEY UPDATE status = 'active';

-- Add your Saturday check-in staff below (replace with real staff emails):
INSERT INTO phantom_staff (email, display_name, status)
VALUES
  ('agamahalvin@gmail.com', 'Lead Organizer', 'active')
ON DUPLICATE KEY UPDATE display_name = VALUES(display_name), status = 'active';

INSERT INTO phantom_staff_event_assignments (staff_id, event_id, role)
SELECT s.id, e.id, 'organizer'
FROM phantom_staff s
CROSS JOIN phantom_events e
WHERE s.email = 'agamahalvin@gmail.com'
  AND e.event_key = 'ssc-2026'
ON DUPLICATE KEY UPDATE role = VALUES(role);
