import express from "express";
import * as ctrl from "../controllers/zoomMeeting.controller.js";

const router = express.Router();

// POST /api/create-meeting - Create a new Zoom meeting (legacy endpoint)
router.post("/create-meeting", ctrl.create);

// CRUD routes for zoom meetings
// Specific routes must come before generic :id routes
router.get("/", ctrl.list);
router.get("/zoom/:zoomId", ctrl.getByZoomId);
router.put("/:id/cancel", ctrl.cancel);
router.get("/:id", ctrl.getById);
router.post("/", ctrl.create);
router.put("/:id", ctrl.update);
router.delete("/:id", ctrl.remove);

export default router;

