import express from 'express';
import apiLogController from '../controllers/apiLogController.js';
import { authenticate } from '../middleware/authMiddleware.js';
import { authorize } from '../middleware/authorizationMiddleware.js';

const router = express.Router();

// All routes require authentication
router.use(authenticate);

// Get logs - requires permissions or admin
router.get('/', apiLogController.getLogs);

// Get last scheduler executions
router.get('/scheduler/last-executions', apiLogController.getLastSchedulerExecutions);

// Get single log by ID
router.get('/:id', apiLogController.getLogById);

export default router;

