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

router.use(authenticate);

router.get('/', dimensionalReportController.getAll);
router.get('/work-order-options', dimensionalReportController.getWorkOrderOptions);
router.get('/work-order-prefill/:workOrderId', dimensionalReportController.getWorkOrderPrefill);
router.get('/:id/pdf', dimensionalReportPDFController.generatePDF);
router.get('/:id', dimensionalReportController.getById);
router.post('/', dimensionalReportController.create);
router.put('/:id', dimensionalReportController.update);
router.patch('/:id/status', dimensionalReportController.updateStatus);
router.delete('/:id', dimensionalReportController.delete);

module.exports = router;

