import { Router } from 'express';
import documentRoutes from './document.routes';
import chatRoutes from './chat.routes';
import precedentRoutes from './precedent.routes';
import caseRoutes from './case.routes';
import templateRoutes from './template.routes';
import draftingRoutes from './drafting.routes';
import googleDriveRoutes from './googleDrive.routes';
import authRoutes from './auth.routes';

const router = Router();

router.get('/health', (req, res) => {
  res.json({ status: 'ok', message: 'AyrisLegal Backend is running' });
});

router.use('/auth', authRoutes);      // POST /api/auth/register, /api/auth/check-device
router.use('/documents', documentRoutes);
router.use('/chat', chatRoutes);
router.use('/cases', caseRoutes);
router.use('/templates', templateRoutes);
router.use('/drafting', draftingRoutes);
router.use('/google-drive', googleDriveRoutes);
router.use('/', precedentRoutes); // Keeps the same paths like /api/search-precedents

export default router;
