const { v4: uuidv4 } = require('uuid');
const logger = require('../utils/logger');

const requestLogger = (req, res, next) => {
  req.correlationId = uuidv4();
  logger.info('Incoming request', {
    method: req.method,
    path: req.path,
    correlationId: req.correlationId
  });
  next();
};

module.exports = { requestLogger };