import { Router } from 'express';
import {
  listVendors,
  getVendor,
  createVendor,
  updateVendor,
  deleteVendor,
} from '../controllers/vendor.controller.js';
import { authenticate, requireAdmin } from '../middleware/auth.middleware.js';

const router = Router();

router.get('/', listVendors);
router.get('/:slug', getVendor);

router.post('/', authenticate, requireAdmin, createVendor);
router.patch('/:id', authenticate, requireAdmin, updateVendor);
router.delete('/:id', authenticate, requireAdmin, deleteVendor);

export default router;
