import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';
import openAiSlice from './openAiSlice';

import usersSlice from "./users/usersSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import accountsSlice from "./accounts/accountsSlice";
import patientsSlice from "./patients/patientsSlice";
import patient_access_grantsSlice from "./patient_access_grants/patient_access_grantsSlice";
import medicationsSlice from "./medications/medicationsSlice";
import medication_schedulesSlice from "./medication_schedules/medication_schedulesSlice";
import calendar_eventsSlice from "./calendar_events/calendar_eventsSlice";
import remindersSlice from "./reminders/remindersSlice";
import cognitive_programsSlice from "./cognitive_programs/cognitive_programsSlice";
import cognitive_exercisesSlice from "./cognitive_exercises/cognitive_exercisesSlice";
import cognitive_sessionsSlice from "./cognitive_sessions/cognitive_sessionsSlice";
import cognitive_attemptsSlice from "./cognitive_attempts/cognitive_attemptsSlice";
import stage_assessmentsSlice from "./stage_assessments/stage_assessmentsSlice";
import voice_assistant_sessionsSlice from "./voice_assistant_sessions/voice_assistant_sessionsSlice";
import iot_devicesSlice from "./iot_devices/iot_devicesSlice";
import iot_telemetry_eventsSlice from "./iot_telemetry_events/iot_telemetry_eventsSlice";
import geofencesSlice from "./geofences/geofencesSlice";
import alertsSlice from "./alerts/alertsSlice";
import alert_notificationsSlice from "./alert_notifications/alert_notificationsSlice";
import shared_dashboard_postsSlice from "./shared_dashboard_posts/shared_dashboard_postsSlice";
import scientific_articlesSlice from "./scientific_articles/scientific_articlesSlice";
import article_recommendationsSlice from "./article_recommendations/article_recommendationsSlice";
import clinical_reportsSlice from "./clinical_reports/clinical_reportsSlice";
import admin_metrics_snapshotsSlice from "./admin_metrics_snapshots/admin_metrics_snapshotsSlice";

export const store = configureStore({
  reducer: {
    style: styleReducer,
    main: mainReducer,
    auth: authSlice,
    openAi: openAiSlice,

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
accounts: accountsSlice,
patients: patientsSlice,
patient_access_grants: patient_access_grantsSlice,
medications: medicationsSlice,
medication_schedules: medication_schedulesSlice,
calendar_events: calendar_eventsSlice,
reminders: remindersSlice,
cognitive_programs: cognitive_programsSlice,
cognitive_exercises: cognitive_exercisesSlice,
cognitive_sessions: cognitive_sessionsSlice,
cognitive_attempts: cognitive_attemptsSlice,
stage_assessments: stage_assessmentsSlice,
voice_assistant_sessions: voice_assistant_sessionsSlice,
iot_devices: iot_devicesSlice,
iot_telemetry_events: iot_telemetry_eventsSlice,
geofences: geofencesSlice,
alerts: alertsSlice,
alert_notifications: alert_notificationsSlice,
shared_dashboard_posts: shared_dashboard_postsSlice,
scientific_articles: scientific_articlesSlice,
article_recommendations: article_recommendationsSlice,
clinical_reports: clinical_reportsSlice,
admin_metrics_snapshots: admin_metrics_snapshotsSlice,
  },
})

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
