import { Router } from 'express';
import { BiometricsController } from './biometrics.controller.js';

/**
 * Crea las rutas del modulo biometrics
 *
 * Todas las rutas son GET (solo lectura):
 * - GET /devices - Listar dispositivos
 * - GET /devices/:deviceId - Obtener dispositivo
 * - GET /credentials - Listar credenciales
 * - GET /credentials/:credentialId - Obtener credencial
 * - GET /enrollment/status - Estado de enrollment
 * - GET /sessions - Listar sesiones
 * - GET /sessions/active - Sesiones activas
 * - GET /activity - Log de actividad
 * - GET /activity/stats - Estadisticas
 */
export function createBiometricsRoutes(controller: BiometricsController): Router {
  const router = Router();

  // Devices
  router.get('/devices', controller.getDevices.bind(controller));
  router.get('/devices/:deviceId', controller.getDeviceById.bind(controller));

  // Credentials
  router.get('/credentials', controller.getCredentials.bind(controller));
  router.get('/credentials/:credentialId', controller.getCredentialById.bind(controller));

  // Enrollment
  router.get('/enrollment/status', controller.getEnrollmentStatus.bind(controller));

  // Sessions
  router.get('/sessions', controller.getSessions.bind(controller));
  router.get('/sessions/active', controller.getActiveSessions.bind(controller));

  // Activity
  router.get('/activity', controller.getActivity.bind(controller));
  router.get('/activity/stats', controller.getVerificationStats.bind(controller));

  return router;
}
