const express = require('express');
const router = express.Router();
const {
  getAllTours,
  getTourById,
  getTourBySlug,
  createTour,
  updateTour,
  deleteTour,
  getNearestUmrahTours
} = require('../controllers/tourController');
const { protect, adminOnly } = require('../middleware/authMiddleware');

router.get('/', getAllTours);
router.get('/nearest-umrah', getNearestUmrahTours);
router.get('/slug/:slug', getTourBySlug);
router.get('/:id', getTourById);
router.post('/', protect, adminOnly, createTour);
router.put('/:id', protect, adminOnly, updateTour);
router.delete('/:id', protect, adminOnly, deleteTour);

module.exports = router;
