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 role_permissionsSlice from "./role_permissions/role_permissionsSlice";
import role_assignmentsSlice from "./role_assignments/role_assignmentsSlice";
import teamsSlice from "./teams/teamsSlice";
import team_membershipsSlice from "./team_memberships/team_membershipsSlice";
import programsSlice from "./programs/programsSlice";
import learning_pathsSlice from "./learning_paths/learning_pathsSlice";
import missionsSlice from "./missions/missionsSlice";
import checklistsSlice from "./checklists/checklistsSlice";
import checklist_itemsSlice from "./checklist_items/checklist_itemsSlice";
import enrollmentsSlice from "./enrollments/enrollmentsSlice";
import mission_attemptsSlice from "./mission_attempts/mission_attemptsSlice";
import quizzesSlice from "./quizzes/quizzesSlice";
import quiz_questionsSlice from "./quiz_questions/quiz_questionsSlice";
import quiz_choicesSlice from "./quiz_choices/quiz_choicesSlice";
import quiz_submissionsSlice from "./quiz_submissions/quiz_submissionsSlice";
import quiz_answersSlice from "./quiz_answers/quiz_answersSlice";
import simulationsSlice from "./simulations/simulationsSlice";
import simulation_stepsSlice from "./simulation_steps/simulation_stepsSlice";
import content_assetsSlice from "./content_assets/content_assetsSlice";
import ai_content_requestsSlice from "./ai_content_requests/ai_content_requestsSlice";
import knowledge_gap_assessmentsSlice from "./knowledge_gap_assessments/knowledge_gap_assessmentsSlice";
import badgesSlice from "./badges/badgesSlice";
import user_badgesSlice from "./user_badges/user_badgesSlice";
import point_ledger_entriesSlice from "./point_ledger_entries/point_ledger_entriesSlice";
import challengesSlice from "./challenges/challengesSlice";
import challenge_participantsSlice from "./challenge_participants/challenge_participantsSlice";
import reward_catalog_itemsSlice from "./reward_catalog_items/reward_catalog_itemsSlice";
import reward_redemptionsSlice from "./reward_redemptions/reward_redemptionsSlice";
import recognition_postsSlice from "./recognition_posts/recognition_postsSlice";
import coaching_sessionsSlice from "./coaching_sessions/coaching_sessionsSlice";
import kpi_definitionsSlice from "./kpi_definitions/kpi_definitionsSlice";
import kpi_measurementsSlice from "./kpi_measurements/kpi_measurementsSlice";
import qa_evaluationsSlice from "./qa_evaluations/qa_evaluationsSlice";
import qa_scorecardsSlice from "./qa_scorecards/qa_scorecardsSlice";
import surveysSlice from "./surveys/surveysSlice";
import survey_questionsSlice from "./survey_questions/survey_questionsSlice";
import survey_responsesSlice from "./survey_responses/survey_responsesSlice";
import survey_response_itemsSlice from "./survey_response_items/survey_response_itemsSlice";
import reportsSlice from "./reports/reportsSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
role_permissions: role_permissionsSlice,
role_assignments: role_assignmentsSlice,
teams: teamsSlice,
team_memberships: team_membershipsSlice,
programs: programsSlice,
learning_paths: learning_pathsSlice,
missions: missionsSlice,
checklists: checklistsSlice,
checklist_items: checklist_itemsSlice,
enrollments: enrollmentsSlice,
mission_attempts: mission_attemptsSlice,
quizzes: quizzesSlice,
quiz_questions: quiz_questionsSlice,
quiz_choices: quiz_choicesSlice,
quiz_submissions: quiz_submissionsSlice,
quiz_answers: quiz_answersSlice,
simulations: simulationsSlice,
simulation_steps: simulation_stepsSlice,
content_assets: content_assetsSlice,
ai_content_requests: ai_content_requestsSlice,
knowledge_gap_assessments: knowledge_gap_assessmentsSlice,
badges: badgesSlice,
user_badges: user_badgesSlice,
point_ledger_entries: point_ledger_entriesSlice,
challenges: challengesSlice,
challenge_participants: challenge_participantsSlice,
reward_catalog_items: reward_catalog_itemsSlice,
reward_redemptions: reward_redemptionsSlice,
recognition_posts: recognition_postsSlice,
coaching_sessions: coaching_sessionsSlice,
kpi_definitions: kpi_definitionsSlice,
kpi_measurements: kpi_measurementsSlice,
qa_evaluations: qa_evaluationsSlice,
qa_scorecards: qa_scorecardsSlice,
surveys: surveysSlice,
survey_questions: survey_questionsSlice,
survey_responses: survey_responsesSlice,
survey_response_items: survey_response_itemsSlice,
reports: reportsSlice,
audit_events: audit_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
