const express = require("express");
const router = express.Router();
const recipeController = require("../../controllers/bom/bomController");
const authenticate = require("../../middlewares/authenticate");


/**
 * @swagger
 * tags:
 *   name: Recipes
 *   description: Production Recipe Management
 */

router.post("/create", authenticate,(req,res)=>{

    // summary: Create a new production recipe
    //  tags: [Recipes]
    //  security: - cookieAuth: []
     recipeController.createRecipe(req,res);
});


router.get("/recipes", authenticate, (req,res)=>{
    recipeController.getRecipes(req, res);
});

router.get("/recipes/:id", authenticate, (req,res)=>{
    recipeController.getRecipeById(req,res);
});


router.get("/recipes/:id/versions", authenticate, (req,res)=>{
    recipeController.getRecipeVersions(req,res);
})

router.put("/recipes/:id", authenticate, (req,res)=>{
    recipeController.updateRecipe(req,res);
})
module.exports = router;