import express from "express";
import {
  getAllRentals,
  getRental,
  createRental,
  returnRental,
  deleteRental
} from "../controllers/rentalController.js";
import { verifyToken } from "../middleware/authMiddleware.js";
import { adminOnly } from "../middleware/roleMiddleware.js";

const router = express.Router();

router.use(verifyToken);

router.get("/", getAllRentals);
router.get("/:id", getRental);
router.post("/", createRental);
router.put("/:id/return", returnRental);
router.delete("/:id", adminOnly, deleteRental);

export default router;