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

/// //////////////////////////////////////////////////////// controllers
const warrantyTermsController = require('../controllers/warrantyTermsController')
const contactPageController = require('../controllers/contactPageController')
const faqController = require('../controllers/faqController')
const learningController = require('../controllers/learningController')
const downloadCategoryController = require('../controllers/downloadCategoryController')
const downloadController = require('../controllers/downloadController')
const iranCitiesController = require('../controllers/iranCitiesController')
const serialsExelController = require('../controllers/serialsExelController')
const helpController = require('../controllers/helpController')
const lotteryPopUpController = require('../controllers/lotteryPopUpController')
const lotteryController = require('../controllers/lotteryController')
const representationController = require('../controllers/representationController')
const announcementController = require('../controllers/announcementController')
const complaintController = require('../controllers/complaintController')
const brandController = require('../controllers/brandController')
const surveyController = require('../controllers/surveyController')

/// //////////////////////////////////////////////////////// routes
/// // survey
router.post('/survey', surveyController.createPublic)

/// ///////////// Brand
router.get('/brand', brandController.getbrands)


/// ///////////// Complaint
router.post('/complaint', complaintController.create)

/// ///////////// warranty terms
router.get('/warranty/page/:page', warrantyTermsController.getAll)
router.get('/warranty/:id(*)', warrantyTermsController.getOne)

/// ///////////// FAQ
router.get('/faq', faqController.getAll)
router.get('/faq/:id(*)', faqController.getOne)

/// ///////////// Learning
router.get('/learning/page/:page', learningController.getAll)
router.get('/learning/:id(*)', learningController.getOne)

/// ///////////// download category
router.get('/dCategory', downloadCategoryController.getAll)
router.get('/dCategory/:id(*)', downloadCategoryController.getOne)

/// ///////////// downloads
router.get('/downloads/page/:category/:page', downloadController.getAll)
router.get('/downloads/:id(*)', downloadController.getOne)
router.get('/downloads-newest', downloadController.getNewest)

/// ///////////// contact us
router.post('/contact', contactPageController.create)

/// ///////////// get iran cities
router.get('/iranCities', iranCitiesController.getIranCities)

/// ///////////// check device serial number
router.post('/checkSerial', serialsExelController.checkSerial)

/// ///////////// get help page
router.get('/help', helpController.get)

/// ///////////// get agents
router.get('/agents', representationController.get_agents)

/// ///////////// lottery
router.get('/lotteryPopUp', lotteryPopUpController.getPopUpInfo)
router.get('/lastLottery', lotteryController.getLastLottery)
router.post('/enrollParticipant', lotteryController.enrollParticipant)

/// //////////// announcement
router.get('/announcement', announcementController.getNotifsForSite)


module.exports = router
