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 organizationsSlice from "./organizations/organizationsSlice";
import doctor_profilesSlice from "./doctor_profiles/doctor_profilesSlice";
import patient_profilesSlice from "./patient_profiles/patient_profilesSlice";
import medical_campsSlice from "./medical_camps/medical_campsSlice";
import appointmentsSlice from "./appointments/appointmentsSlice";
import consultationsSlice from "./consultations/consultationsSlice";
import medical_reportsSlice from "./medical_reports/medical_reportsSlice";
import medicinesSlice from "./medicines/medicinesSlice";
import inventory_itemsSlice from "./inventory_items/inventory_itemsSlice";
import prescriptionsSlice from "./prescriptions/prescriptionsSlice";
import prescription_itemsSlice from "./prescription_items/prescription_itemsSlice";
import medicine_dispatchesSlice from "./medicine_dispatches/medicine_dispatchesSlice";
import vaccinationsSlice from "./vaccinations/vaccinationsSlice";
import patient_vaccinationsSlice from "./patient_vaccinations/patient_vaccinationsSlice";
import remindersSlice from "./reminders/remindersSlice";
import chat_sessionsSlice from "./chat_sessions/chat_sessionsSlice";
import messagesSlice from "./messages/messagesSlice";
import video_callsSlice from "./video_calls/video_callsSlice";
import chatbot_interactionsSlice from "./chatbot_interactions/chatbot_interactionsSlice";
import feedbacksSlice from "./feedbacks/feedbacksSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
doctor_profiles: doctor_profilesSlice,
patient_profiles: patient_profilesSlice,
medical_camps: medical_campsSlice,
appointments: appointmentsSlice,
consultations: consultationsSlice,
medical_reports: medical_reportsSlice,
medicines: medicinesSlice,
inventory_items: inventory_itemsSlice,
prescriptions: prescriptionsSlice,
prescription_items: prescription_itemsSlice,
medicine_dispatches: medicine_dispatchesSlice,
vaccinations: vaccinationsSlice,
patient_vaccinations: patient_vaccinationsSlice,
reminders: remindersSlice,
chat_sessions: chat_sessionsSlice,
messages: messagesSlice,
video_calls: video_callsSlice,
chatbot_interactions: chatbot_interactionsSlice,
feedbacks: feedbacksSlice,
  },
})

// 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
