const express = require('express');
const router = express.Router();
const { authenticate } = require('../middlewares/auth');
const measuringInstrumentController = require('../controllers/measuringInstrumentController');

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

// Get calibration due report
router.get('/calibration-due', measuringInstrumentController.getCalibrationDueReport);

// Get all measuring instruments
router.get('/', measuringInstrumentController.getAll);

// Get by location
router.get('/location/:location', measuringInstrumentController.getByLocation);

// Get by ID
router.get('/:id', measuringInstrumentController.getById);

// Create
router.post('/', measuringInstrumentController.create);

// Update
router.put('/:id', measuringInstrumentController.update);

// Delete
router.delete('/:id', measuringInstrumentController.delete);

module.exports = router;
