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 public_profilesSlice from "./public_profiles/public_profilesSlice";
import private_profilesSlice from "./private_profiles/private_profilesSlice";
import membership_plansSlice from "./membership_plans/membership_plansSlice";
import membershipsSlice from "./memberships/membershipsSlice";
import stripe_eventsSlice from "./stripe_events/stripe_eventsSlice";
import coursesSlice from "./courses/coursesSlice";
import lessonsSlice from "./lessons/lessonsSlice";
import enrollmentsSlice from "./enrollments/enrollmentsSlice";
import lesson_progressSlice from "./lesson_progress/lesson_progressSlice";
import artifactsSlice from "./artifacts/artifactsSlice";
import trophiesSlice from "./trophies/trophiesSlice";
import user_trophiesSlice from "./user_trophies/user_trophiesSlice";
import ai_gatewaysSlice from "./ai_gateways/ai_gatewaysSlice";
import usage_limit_policiesSlice from "./usage_limit_policies/usage_limit_policiesSlice";
import ai_tasksSlice from "./ai_tasks/ai_tasksSlice";
import ai_requestsSlice from "./ai_requests/ai_requestsSlice";
import ai_outputsSlice from "./ai_outputs/ai_outputsSlice";
import coaching_sessionsSlice from "./coaching_sessions/coaching_sessionsSlice";
import messagesSlice from "./messages/messagesSlice";
import resume_documentsSlice from "./resume_documents/resume_documentsSlice";
import feedback_entriesSlice from "./feedback_entries/feedback_entriesSlice";
import tracking_eventsSlice from "./tracking_events/tracking_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
public_profiles: public_profilesSlice,
private_profiles: private_profilesSlice,
membership_plans: membership_plansSlice,
memberships: membershipsSlice,
stripe_events: stripe_eventsSlice,
courses: coursesSlice,
lessons: lessonsSlice,
enrollments: enrollmentsSlice,
lesson_progress: lesson_progressSlice,
artifacts: artifactsSlice,
trophies: trophiesSlice,
user_trophies: user_trophiesSlice,
ai_gateways: ai_gatewaysSlice,
usage_limit_policies: usage_limit_policiesSlice,
ai_tasks: ai_tasksSlice,
ai_requests: ai_requestsSlice,
ai_outputs: ai_outputsSlice,
coaching_sessions: coaching_sessionsSlice,
messages: messagesSlice,
resume_documents: resume_documentsSlice,
feedback_entries: feedback_entriesSlice,
tracking_events: tracking_eventsSlice,
  },
})

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