import express from "express";
import {
  createBooking,
  getBookings,
  getBookingById,
  updateBooking,
  deleteBooking,
  getBookedSlots,
  confirmBookingFromStripe,
  handleZoomWebhook,
  getRecordings,
} from "../controllers/booking.js";

const router = express.Router();

// ✅ SPECIFIC routes PEHLE — warna /:id inhe pakad leta hai
router.post("/confirm-from-stripe", confirmBookingFromStripe);
router.get("/booked-slots", getBookedSlots);
router.post("/zoom-webhook", handleZoomWebhook);  // ✅ Zoom recording webhook
router.get("/recordings", getRecordings);          // ✅ Student replays

// Generic routes BAAD mein
router.post("/", createBooking);
router.get("/", getBookings);
router.get("/:id", getBookingById);
router.put("/:id", updateBooking);
router.delete("/:id", deleteBooking);

export default router;