import { Router } from "express"; import { getDashboardStats, getAdminUsers, updateUserRole, toggleUserActive, deleteUserHandler, getSystemSettings } from "../controllers/admin"; import { authenticate, authorize } from "../middleware/auth"; const router = Router(); router.get("/dashboard", authenticate, authorize("admin"), getDashboardStats); router.get("/users", authenticate, authorize("admin"), getAdminUsers); router.put("/users/:id/role", authenticate, authorize("admin"), updateUserRole); router.put("/users/:id/toggle", authenticate, authorize("admin"), toggleUserActive); router.delete("/users/:id", authenticate, authorize("admin"), deleteUserHandler); router.get("/settings", authenticate, authorize("admin"), getSystemSettings); export default router;