import express from 'express';
import { auth } from '../../middleware/auth';
import {
  getUsers,
  createUser,
  updateUser,
  updateUserPermissions,
  deleteUser,
} from './controllers/users';

const router = express.Router();

// All routes require authentication
router.use(auth);

router.get('/', auth, getUsers);
router.post('/', createUser);
router.put('/:id', updateUser);
router.put('/:id/permissions', auth, updateUserPermissions);
router.delete('/:id', deleteUser);

export default router;