const express = require('express');
const { authenticate, authorize } = require('../middleware/auth');
const RouteController = require('../controllers/RouteController');

const router = express.Router();

router.get('/', RouteController.getAll);
router.get('/:id', RouteController.getById);
router.get('/:id/schedules', RouteController.getSchedulesForRoute);
router.post('/', authenticate, authorize('admin', 'manager'), RouteController.create);

module.exports = router;
