const controllers = require('../controllers/user')
const router = require('express').Router()
const { Admited } = require('../middleware/authMiddleware')

// DB
router.get('/user/:id', Admited(['Admin', 'ConcernedUser']), controllers.get);
router.post('/user/', Admited(['Unconnected']), controllers.post)
router.put('/user/:id', Admited(['Admin', 'ConcernedUser']), controllers.put)
router.delete('/user/:id', Admited(['Admin', 'ConcernedUser']), controllers.delete)

router.get('/current', Admited(['NormalUser']), controllers.current)
router.get('/agentConnected', Admited(['Agent']), controllers.agentConnected)
router.get('/getAllUsers', Admited(['Admin']), controllers.getAllUsers)

module.exports = router