import { Router } from 'express';
import adminRoutes from '../modules/admin/admin.routes';
import authRoutes from '../modules/auth/auth.routes';
import contactsRoutes from '../modules/contacts/contacts.routes';
import crmRoutes from '../modules/crm/crm.routes';
import dashboardRoutes from '../modules/dashboard/dashboard.routes';
import hrRoutes from '../modules/hr/hr.routes';
import inventoryRoutes from '../modules/inventory/inventory.routes';
import projectsRoutes from '../modules/projects/projects.routes';
import marketingRoutes from '../modules/marketing/marketing.routes';
import tendersRoutes from '../modules/tenders/tenders.routes';
import notificationsRoutes from '../modules/notifications/notifications.routes';
import suppliersRoutes from '../modules/suppliers/suppliers.routes';

const router = Router();

// Module routes
router.use('/admin', adminRoutes);
router.use('/dashboard', dashboardRoutes);
router.use('/auth', authRoutes);
router.use('/contacts', contactsRoutes);
router.use('/suppliers', suppliersRoutes);
router.use('/crm', crmRoutes);
router.use('/hr', hrRoutes);
router.use('/inventory', inventoryRoutes);
router.use('/projects', projectsRoutes);
router.use('/marketing', marketingRoutes);
router.use('/tenders', tendersRoutes);
router.use('/notifications', notificationsRoutes);

// API info
router.get('/', (req, res) => {
  res.json({
    name: 'Z.CRM API',
    version: '1.0.0',
    description: 'نظام إدارة علاقات العملاء - Enterprise CRM System',
    modules: [
      'Auth',
      'Contact Management',
      'Supplier Management',
      'CRM',
      'HR Management',
      'Inventory & Assets',
      'Tasks & Projects',
      'Marketing',
      'Tender Management',
    ],
  });
});

export default router;

