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

router.get('/getInfos/:url', Admited(['NormalUser']), controllers.getInfos)
router.get('/getPictures/:url', Admited(['NormalUser']), controllers.getPictures)
router.get('/getLotsBySale/:id', Admited(['NormalUser']), controllers.getLotsBySale)

// DB
router.get('/lot/:id', Admited(['Admin']), controllers.get)
router.post('/lot/', Admited(['Admin']), controllers.post)
router.put('/lot/:id', Admited(['Admin']), controllers.put)
router.delete('/lot/:id', Admited(['Admin']), controllers.delete)

// Live Data
router.post('/NextItem/', Admited(['Agent', 'Admin']), controllers.NextItem)
router.post('/AuctionedItem/', Admited(['Agent', 'Admin']), controllers.AuctionedItem)
router.post('/Bid/', Admited(['Agent', 'Admin']), controllers.Bid)

module.exports = router