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 onboarding_responsesSlice from "./onboarding_responses/onboarding_responsesSlice";
import external_accountsSlice from "./external_accounts/external_accountsSlice";
import skill_nodesSlice from "./skill_nodes/skill_nodesSlice";
import user_skill_node_awardsSlice from "./user_skill_node_awards/user_skill_node_awardsSlice";
import projectsSlice from "./projects/projectsSlice";
import external_signalsSlice from "./external_signals/external_signalsSlice";
import coursesSlice from "./courses/coursesSlice";
import course_phasesSlice from "./course_phases/course_phasesSlice";
import lessonsSlice from "./lessons/lessonsSlice";
import lesson_variantsSlice from "./lesson_variants/lesson_variantsSlice";
import quiz_questionsSlice from "./quiz_questions/quiz_questionsSlice";
import build_tasksSlice from "./build_tasks/build_tasksSlice";
import enrollmentsSlice from "./enrollments/enrollmentsSlice";
import lesson_progressSlice from "./lesson_progress/lesson_progressSlice";
import quiz_attemptsSlice from "./quiz_attempts/quiz_attemptsSlice";
import task_submissionsSlice from "./task_submissions/task_submissionsSlice";
import ai_chat_sessionsSlice from "./ai_chat_sessions/ai_chat_sessionsSlice";
import ai_chat_messagesSlice from "./ai_chat_messages/ai_chat_messagesSlice";
import career_coach_reportsSlice from "./career_coach_reports/career_coach_reportsSlice";
import usage_limitsSlice from "./usage_limits/usage_limitsSlice";
import pricing_plansSlice from "./pricing_plans/pricing_plansSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import cohortsSlice from "./cohorts/cohortsSlice";
import organization_membershipsSlice from "./organization_memberships/organization_membershipsSlice";
import talent_inquiriesSlice from "./talent_inquiries/talent_inquiriesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
onboarding_responses: onboarding_responsesSlice,
external_accounts: external_accountsSlice,
skill_nodes: skill_nodesSlice,
user_skill_node_awards: user_skill_node_awardsSlice,
projects: projectsSlice,
external_signals: external_signalsSlice,
courses: coursesSlice,
course_phases: course_phasesSlice,
lessons: lessonsSlice,
lesson_variants: lesson_variantsSlice,
quiz_questions: quiz_questionsSlice,
build_tasks: build_tasksSlice,
enrollments: enrollmentsSlice,
lesson_progress: lesson_progressSlice,
quiz_attempts: quiz_attemptsSlice,
task_submissions: task_submissionsSlice,
ai_chat_sessions: ai_chat_sessionsSlice,
ai_chat_messages: ai_chat_messagesSlice,
career_coach_reports: career_coach_reportsSlice,
usage_limits: usage_limitsSlice,
pricing_plans: pricing_plansSlice,
subscriptions: subscriptionsSlice,
payments: paymentsSlice,
cohorts: cohortsSlice,
organization_memberships: organization_membershipsSlice,
talent_inquiries: talent_inquiriesSlice,
  },
})

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