const router = require("express").Router();
const { authenticateAdmin, audit } = require("../../middleware");

const AdminBotsController = require("../../controllers/admin/botController");

// List
router.get("/", authenticateAdmin, AdminBotsController.getBots);

// Create
router.post("/", authenticateAdmin, audit("bots.create", "bot"), AdminBotsController.createBot);

// Read
router.get("/:botId", authenticateAdmin, AdminBotsController.getBotById);

// Update
router.put("/:botId", authenticateAdmin, audit("bots.update", "bot"), AdminBotsController.updateBot);

// Delete
router.delete("/:botId", authenticateAdmin, audit("bots.delete", "bot"), AdminBotsController.deleteBot);

// Status quick action (optional)
router.post("/:botId/status", authenticateAdmin, audit("bots.status", "bot"), AdminBotsController.updateBotStatus);

module.exports = router;

/**
 * Mount example (where you define admin routes):
 * router.use("/bots", require("./routes/admin/adminBotsRoutes"));
 *
 * If your admin routes are under "/manage", this becomes:
 *  /manage/bots
 */