const express = require("express");
const router = express.Router();
const salesReturnController = require("../../controllers/sales/salesReturnController");
const authenticate = require("../../middlewares/authenticate");



/**
 * @swagger
 * /api/return:
 *   post: summary: Create new sales return
 */
router.post("/create",authenticate, (req,res) =>{
    /*  
  #swagger.tags = ['Sales Return']
  #swagger.summary = 'Create a new sales return'
  #swagger.security = [{ "bearerAuth": [] }]
*/
  salesReturnController.createSalesReturn(req,res) 
}
);

router.put("/sales-returns/:id",authenticate, (req,res)=>{
    salesReturnController.updateSalesReturn(req,res);
});   

router.get("/sales-returns/:id", authenticate, (req,res)=>{
    salesReturnController.getSalesReturnById(req,res);
});

router.get("/sales-return/all",authenticate, (req,res)=>{
    salesReturnController.getSalesReturns(req,res);
});
router.delete("/sales-returns/:id", authenticate, (req,res)=>{
    salesReturnController.deleteSalesReturn(req,res);
});


module.exports = router;