const express = require('express');
const router = express.Router();
const testimonialController = require('../controllers/testimonialController');
const { protect } = require('../middleware/authMiddleware');

// Public routes
router.get('/public', testimonialController.getAllTestimonials);

// Admin routes (require authentication)
router.get('/', protect, testimonialController.getAdminTestimonials);
router.get('/:id', protect, testimonialController.getTestimonialById);
router.post('/', protect, testimonialController.createTestimonial);
router.put('/:id', protect, testimonialController.updateTestimonial);
router.delete('/:id', protect, testimonialController.deleteTestimonial);

module.exports = router;
