const express = require('express');
const router = express.Router();
const { 
    createBooking, 
    getUserBookings, 
    getOwnerBookings,
    cancelBooking 
} = require('../controllers/bookingController');
const { protect, ownerOnly } = require('../middleware/authMiddleware');

router.post('/', protect, createBooking);
router.get('/my', protect, getUserBookings);
router.get('/owner', protect, ownerOnly, getOwnerBookings);
router.delete('/:id', protect, cancelBooking);

module.exports = router;
