const express = require('express')
const router = express.Router()
const vendorController = require('../../controllers/admin/VendorController.js')
const verifyJWT = require('../../middleware/VerifyJWT.js');
const checkRole = require('../../middleware/CheckRole.js');

router.get('/', verifyJWT, checkRole(['admin', 'sales']), vendorController.getAllVendor);
router.post('/', verifyJWT, checkRole(['admin', 'sales']), vendorController.storeVendor);
router.get('/:id', verifyJWT, checkRole(['admin', 'sales']), vendorController.showVendor);
router.patch('/:id', verifyJWT, checkRole(['admin', 'sales']), vendorController.updateVendor);
router.delete('/:id', verifyJWT, checkRole(['admin']), vendorController.deleteVendor);

module.exports = router;