const express = require('express');
const router = express.Router();
const { 
  getAllCars, 
  addCar, 
  updateCar, 
  deleteCar,
  getCarPricing,
  getCarsWithAlerts
} = require('../controllers/carController');const { auth, admin } = require('../middleware/authMiddleware');

router.get('/', auth, admin, getAllCars);
router.get('/:id/pricing', auth, admin, getCarPricing);
router.get('/alerts', auth, admin, getCarsWithAlerts);  // newly added one


router.post('/', auth, admin, addCar);
router.put('/:id', auth, admin, updateCar);
router.delete('/:id', auth, admin, deleteCar);

module.exports = router;
