import express from 'express';
import { initSuperAdmin, createClientAsSuperAdmin } from '../controllers/superAdminController.js';
import { requireAuth, requireRole } from '../middleware/auth.js';

const router = express.Router();

// One-time initializer, no auth before first SA exists
router.post('/init', initSuperAdmin);

// After SA exists, protect client creation
router.post('/clients', requireAuth, requireRole('SUPER_ADMIN'), createClientAsSuperAdmin);

export default router;