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

// AuctionAgent
router.get('/getSaleInfos/:url', Admited(['NormalUser']), controllers.getSaleInfos)
router.get('/prepareSale/:id', Admited(['NormalUser']), controllers.prepareSale)
router.get('/followSale/:id', Admited(['NormalUser']), controllers.followSale)


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


router.get('/getAll/', Admited(['Admin']), controllers.getAll);
router.get('/getByUrl/:url', Admited(['Agent', 'Admin']), controllers.getByUrl)
router.get('/postProcessing/:id', Admited(['Admin']), controllers.postProcessing)
router.get('/SaleStatXsl/:id', Admited(['Admin']), controllers.SaleStatXsl)


module.exports = router