// Importation des modules nécessaires
const express = require('express');
// Création d'un nouvel objet Router
const router = express.Router();

// Importation des contrôleurs pour gérer les différentes routes
const rootController = require('./controllers/rootController');
const authController = require('./controllers/authController');
const parcoursController = require('./controllers/parcoursController');
const contratController = require('./controllers/contratController');
const navParcoursController = require('./controllers/navParcoursController');
const clientController = require('./controllers/clientController');
const intermediaireController = require('./controllers/intermediaireController');
const generateRCController = require('./controllers/generateRCController');
const generateTppcController = require('./controllers/generateTppcController');
const generateFacController = require('./controllers/generateFacController');
const rcController = require('./controllers/rcController');
const facController = require('./controllers/facController');
const tppcController = require('./controllers/tppcController');
const historiqueParcoursController = require('./controllers/historiqueParcoursController');
const userController = require('./controllers/userController');
const regionController = require('./controllers/regionController');
const downloadController = require('./controllers/utilsController');

// Association des contrôleurs aux routes
router.use('/', rootController);
router.use('/auth', authController);
router.use('/parcours', parcoursController);
router.use('/contrat', contratController);
router.use('/navParcours', navParcoursController);
router.use('/client', clientController);
router.use('/intermediaire', intermediaireController);
router.use('/generate', [generateRCController, generateFacController, generateTppcController]);
router.use('/rc', rcController);
router.use('/fac', facController);
router.use('/tppc', tppcController);
router.use('/historiqueParcours', historiqueParcoursController);
router.use('/user', userController);
router.use('/region', regionController);
router.use('/download', downloadController);

module.exports = router;