const router = require('express').Router();
const { authMiddleware } = require('../middleware/auth');
const c = require('../controllers/biochemController');

router.use(authMiddleware);

router.get('/elements',               c.getElements);
router.get('/molecules',              c.getMolecules);
router.get('/molecules/:id',          c.getMolecule);
router.post('/validate',              c.validate);
router.post('/analyze',               c.analyze);
router.get('/reactions',              c.getReactions);
router.get('/challenges',             c.getChallenges);
router.post('/challenges/:id/solve',  c.solveChallenge);
router.get('/saved',                  c.getSaved);
router.post('/saved',                 c.saveMolecule);
router.delete('/saved/:id',           c.deleteSaved);
router.get('/pathways',               c.getPathways);
router.get('/pathways/progress',      c.getPathwayProgress);
router.post('/pathways/progress',     c.savePathwayProgress);

module.exports = router;
