const express = require('express');
const router = express.Router();
const { requireAuth, requirePage } = require('../middleware/auth');
const ctrl = require('../controllers/partnerAccountController');

router.use(requireAuth);

router.get('/company/:companyId', requirePage('purchasing_accounts'), ctrl.listByCompany);
router.post('/', requirePage('purchasing_accounts'), ctrl.create);
router.put('/:id', requirePage('purchasing_accounts'), ctrl.update);
router.delete('/:id', requirePage('purchasing_accounts'), ctrl.deactivate);

module.exports = router;
