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

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

// Get all in-process checklists
router.get('/', inProcessCheckListController.getAll);

// Get PDF (must be before /:id to avoid route conflict)
router.get('/:id/pdf', inProcessCheckListPDFController.generatePDF);

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

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

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

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

module.exports = router;
