// src/database/database_manager.js
/**
 * Ce fichier est conservé pour la rétrocompatibilité mais redirige vers les nouveaux modèles.
 * Il sera progressivement supprimé lorsque toutes les références auront été mises à jour.
 */

const Project = require('../models/Project');
const Measurement = require('../models/Measurement');
const Video = require('../models/Video');
const Camera = require('../models/Camera');

// Structure de redirection pour la compatibilité
const database_manager = {
  project: {
    get_all_projects: Project.getAllProjects,
    get_project_by_id: Project.getProjectById,
    create_project: Project.createProject,
    edit_project_by_id: Project.updateProject,
    delete_project: Project.deleteProject,
    find_current_rendering_project: Project.findCurrentRenderingProject
  },
  measurement: {
    get_all_measurements: Measurement.getAllMeasurements,
    get_measurement_by_id: Measurement.getMeasurementById,
    get_measurement_by_project_id_and_order_id: Measurement.getMeasurementByProjectAndOrderId,
    get_measurements_by_project_id: Measurement.getMeasurementsByProjectId,
    create_measurement: Measurement.createMeasurement,
    edit_measurement_by_id: Measurement.updateMeasurement,
    delete_measurement: Measurement.deleteMeasurement,
    get_next_order_id: Measurement.getNextOrderId
  },
  video: {
    get_all_videos: Video.getAllVideos,
    get_video_by_id: Video.getVideoById,
    get_videos_by_project_id: Video.getVideosByProjectId,
    create_video: Video.createVideo,
    edit_video_by_id: Video.updateVideo,
    delete_video: Video.deleteVideo
  },
  capture: {
    get_camera: Camera.getCamera,
    edit_camera: Camera.updateCamera,
    init_camera: Camera.initializeCamera
  }
};

module.exports = database_manager;
