const registerRouter = require('./application/register')
const loginRouter = require('./application/login')
const verifyRouter = require('./application/verify')
const provincesRouter = require('./application/provinces')
const citiesRouter = require('./application/city')
const projectsRouter = require('./application/projects')
const usersRouter = require('./application/users')
const postsRouter = require('./application/posts')
const expertiseRouter = require('./application/expertise')
const profileRouter = require('./application/profile')
const workroomRouter = require('./application/workroom')
const messagesRouter = require('./application/messages')
const searchRouter = require('./application/search')
const searchRouterWeb = require('./application/search-web')
const financialRouter = require('./application/financial')
const notificationRouter = require('./application/notification')
const ticketsRouter = require('./application/tickets')
const advertisingRouter = require('./application/advertising')
const settingsRouter = require('./application/settings')
const versionRouter = require('./application/version')
const offerRouter = require('./application/offers')
const academyRoute = require('./application/academy')

const projectsPanelRouter = require('./panel/projects')
const postsPanelRouter = require('./panel/posts')
const expertisePanelRouter = require('./panel/expertise')
const loginPanelRouter = require('./panel/login')
const usersPanelRouter = require('./panel/users')
const ticketsPanelRouter = require('./panel/tickets')
const financialPanelRouter = require('./panel/financial')
const commentsPanelRouter = require('./panel/comments')
const advertisingPanelRouter = require('./panel/advertising')
const shopsPanelRouter = require('./panel/shops')
const settingsPanelRouter = require('./panel/settings')
const versionPanelRouter = require('./panel/version')

const auth = require('../middlewares/auth')
const adminAuth = require('../middlewares/adminAuth')
module.exports = (app) => {
  // App
  app.use('/api/v1/register', registerRouter)
  app.use('/api/v1/login', loginRouter)
  app.use('/api/v1/verify', [auth], verifyRouter)
  app.use('/api/v1/provinces', provincesRouter)
  app.use('/api/v1/cities', citiesRouter)
  app.use('/api/v1/projects', projectsRouter)
  app.use('/api/v1/users', usersRouter)
  app.use('/api/v1/posts', postsRouter)
  app.use('/api/v1/expertise', expertiseRouter)
  app.use('/api/v1/profile', profileRouter)
  app.use('/api/v1/workroom', [auth], workroomRouter)
  app.use('/api/v1/messages', [auth], messagesRouter)
  app.use('/api/v1/notifications', [auth], notificationRouter)
  app.use('/api/v1/search', [auth], searchRouter)
  app.use('/api/v1/search-web', searchRouterWeb)
  app.use('/api/v1/financial', [auth], financialRouter)
  app.use('/api/v1/tickets', [auth], ticketsRouter)
  app.use('/api/v1/offers', offerRouter)
  app.use('/api/v1/advertising', advertisingRouter)
  app.use('/api/v1/settings', settingsRouter)
  app.use('/api/v1/version', versionRouter)
 app.use('/api/v1/academy', academyRoute)
 
  // Panel
  app.use('/api/v1/panel/login', loginPanelRouter)
  app.use('/api/v1/panel/users', usersPanelRouter)
  app.use('/api/v1/panel/projects', [adminAuth], projectsPanelRouter)
  app.use('/api/v1/panel/posts', [adminAuth], postsPanelRouter)
  app.use('/api/v1/panel/expertise', [adminAuth], expertisePanelRouter)
  app.use('/api/v1/panel/tickets', [adminAuth], ticketsPanelRouter)
  app.use('/api/v1/panel/financial', [adminAuth], financialPanelRouter)
  app.use('/api/v1/panel/comments', [adminAuth], commentsPanelRouter)
  app.use('/api/v1/panel/advertising', [adminAuth], advertisingPanelRouter)
  app.use('/api/v1/panel/shops', [adminAuth], shopsPanelRouter)
  app.use('/api/v1/panel/settings', [adminAuth], settingsPanelRouter)
  app.use('/api/v1/panel/version', [adminAuth], versionPanelRouter)
}
