const express = require('express');
const { protect } = require('../middleware/auth');
const {
  addSparePart,
  getSpareParts,
  getSparePartById,
  updateSparePart,
  deleteSparePart,
} = require('../controllers/sparePartController');

const router = express.Router();
router.use(protect);

router.post('/add', addSparePart);
router.get('/list', getSpareParts);
router.get('/:id', getSparePartById);
router.put('/:id', updateSparePart);
router.delete('/:id', deleteSparePart);

module.exports = router;
