const express = require('express');
const { Test } = require('../models');
const router = express.Router();

 // Import routes
 /* const adminRoutes = require('./admin') */
 const publicRoutes = require('./public');
const authRoutes = require('./auth');
const dashboardRoutes = require('./dashboard');
const marketRoutes = require('./markets');
const planRoutes = require('./plans');
const walletRoutes = require('./wallets');
const tradingRoutes = require('./trading');
const copyTradingRoutes = require('./copyTrading');
const referralRoutes = require('./referrals');
const notificationRoutes = require('./notifications');
const fundingRoutes = require('./funding');
const otpRoutes = require('./otp');
const botRoutes = require('./bot');
const spotRoutes = require('./spot');
const watchlistRoutes = require('./watchlist')
const signalRoutes = require('./signal');
const profileRoutes = require('./profile');
const securityRoutes = require('./security')
const kycRoutes = require('./kyc')
const forexRoutes = require('./forex');
const assetDataRoutes = require('./assetData');
//const marketDataRoutes = require('./marketdata');
const optionsRoutes = require('./options');
const optionRoutes = require('./option');
//const perpetualRoutes = require('./perpetual');
const supportRoutes = require('./support');
const ratesRoutes = require('./rates');

/* const userRoutes = require('./users');
const notificationRoutes = require('./notifications');
const alertRoutes = require('./alerts');
const stakingRoutes = require('./staking');
const referralRoutes = require('./referrals');
const supportRoutes = require('./support');
const kycRoutes = require('./kyc');
const apiKeyRoutes = require('./apiKeys');
 */

// Mount routes
/* router.use('/managess', adminRoutes); */
router.use('/auth', authRoutes);
router.use('/dashboard', dashboardRoutes);
router.use('/plans', planRoutes);
router.use('/markets', marketRoutes);
//router.use('/market-data', marketDataRoutes);
router.use('/watchlist', watchlistRoutes);
router.use('/wallets', walletRoutes);
router.use('/copy-trading', copyTradingRoutes);
router.use('/referrals', referralRoutes);
router.use('/notifications', notificationRoutes);
router.use('/public', publicRoutes); 
router.use('/trading', tradingRoutes);
router.use('/funding', fundingRoutes);
router.use('/bots', botRoutes);
router.use('/spot', spotRoutes);
router.use('/signals', signalRoutes);
router.use('/profile', profileRoutes);
router.use('/security', securityRoutes);
router.use('/verification', kycRoutes);
router.use('/fx', forexRoutes);
router.use('/options', optionsRoutes);
router.use('/option', optionRoutes);
router.use('/otp' , otpRoutes)
//router.use('/perpetual', perpetualRoutes);
router.use('/support', supportRoutes);
router.use('/asset-data', assetDataRoutes);
router.use('/rates', ratesRoutes);
/* 
router.use('/users', userRoutes);
router.use('/notifications', notificationRoutes);
router.use('/alerts', alertRoutes);
router.use('/staking', stakingRoutes);

router.use('/kyc', kycRoutes);
router.use('/api-keys', apiKeyRoutes);
*/

// Health check route
router.get('/health', async (req, res) => {
  const test = await Test.findAll({})

  res.status(200).json({
    success: true,
    test: test,
    message: 'API is running',
    timestamp: new Date().toISOString(),
    version: process.env.API_VERSION || 'v1',
  });
});

module.exports = router;
