const {Router} = require('express')
const router = Router()

/////////////////////////////////////////////////////////// controllers
const sliderController = require('../controllers/sliderController')
const productController = require('../controllers/productController')
const productCategoryController = require('../controllers/productCategoryController')
const blogCategoryController = require('../controllers/blogCategoryController')
const blogPostController = require('../controllers/blogPostController')
const projectController = require('../controllers/projectController')
const contactPageController = require('../controllers/contactPageController')
const contactUsReasonController = require('../controllers/contactUsReasonController')
const mainCatalogController = require('../controllers/mainCatalogController')
const historyController = require('../controllers/historyController')
const calculationModule = require('../controllers/calculationModule')
/////////////////////////////////////////////////////////// routes

//////////////// slider
router.get('/slider', sliderController.getAll)
router.get('/slider/:id', sliderController.getOne)

//////////////// blog category
router.get('/blogCategories', blogCategoryController.getAll)
router.get('/blogCategories/:id', blogCategoryController.getOne)

//////////////// blog posts
router.get('/blog', blogPostController.getAll)
router.get('/blog/:id', blogPostController.getOne)

//////////////// product categories
router.get('/productCategories', productCategoryController.getAll)
router.get('/productCategories/:id', productCategoryController.getOne)

//////////////// products
router.get('/favoriteProducts', productController.getFavoriteProducts)
router.get('/products/', productController.getAllProducts)
router.get('/product/:id', productController.getOneProduct)

//////////////// projects
router.get('/projects', projectController.getAll)
router.get('/projects/:id', projectController.getOne)

//////////////// contact us
router.post('/contact', contactPageController.create)
/// contact us reason
router.get('/contact/reason', contactUsReasonController.getAll)

//////////////// main catalog
router.get('/catalog', mainCatalogController.get)

//////////////// history
router.get('/history', historyController.getAll)
router.get('/history/:id', historyController.getOne)

//////////////// calculation
router.get('/calculation/values', calculationModule.getValues)
router.post('/calculation/relativeValues', calculationModule.getRelativeValues)
router.post('/calculate', calculationModule.calculate)

module.exports = router
