const express = require('express');
const { getBookings, getBookingsByUser, createBooking, cancelBooking } = require('../controllers/bookingController');

const router = express.Router();

router.route('/')
  .get(getBookings)
  .post(createBooking);

router.route('/user/:userId')
  .get(getBookingsByUser);

router.route('/:id/cancel')
  .put(cancelBooking);

module.exports = router;