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 schoolsSlice from "./schools/schoolsSlice";
import grade_levelsSlice from "./grade_levels/grade_levelsSlice";
import subjectsSlice from "./subjects/subjectsSlice";
import classroomsSlice from "./classrooms/classroomsSlice";
import classroom_membershipsSlice from "./classroom_memberships/classroom_membershipsSlice";
import teaching_assignmentsSlice from "./teaching_assignments/teaching_assignmentsSlice";
import homeworksSlice from "./homeworks/homeworksSlice";
import homework_rubricsSlice from "./homework_rubrics/homework_rubricsSlice";
import homework_extensionsSlice from "./homework_extensions/homework_extensionsSlice";
import homework_submissionsSlice from "./homework_submissions/homework_submissionsSlice";
import submission_gradesSlice from "./submission_grades/submission_gradesSlice";
import rubric_scoresSlice from "./rubric_scores/rubric_scoresSlice";
import gradebooksSlice from "./gradebooks/gradebooksSlice";
import gradebook_columnsSlice from "./gradebook_columns/gradebook_columnsSlice";
import gradebook_entriesSlice from "./gradebook_entries/gradebook_entriesSlice";
import adviser_reportsSlice from "./adviser_reports/adviser_reportsSlice";
import announcementsSlice from "./announcements/announcementsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import account_applicationsSlice from "./account_applications/account_applicationsSlice";
import guardiansSlice from "./guardians/guardiansSlice";
import security_eventsSlice from "./security_events/security_eventsSlice";
import support_settingsSlice from "./support_settings/support_settingsSlice";
import feedback_itemsSlice from "./feedback_items/feedback_itemsSlice";
import eventsSlice from "./events/eventsSlice";
import ai_monitoring_rulesSlice from "./ai_monitoring_rules/ai_monitoring_rulesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
schools: schoolsSlice,
grade_levels: grade_levelsSlice,
subjects: subjectsSlice,
classrooms: classroomsSlice,
classroom_memberships: classroom_membershipsSlice,
teaching_assignments: teaching_assignmentsSlice,
homeworks: homeworksSlice,
homework_rubrics: homework_rubricsSlice,
homework_extensions: homework_extensionsSlice,
homework_submissions: homework_submissionsSlice,
submission_grades: submission_gradesSlice,
rubric_scores: rubric_scoresSlice,
gradebooks: gradebooksSlice,
gradebook_columns: gradebook_columnsSlice,
gradebook_entries: gradebook_entriesSlice,
adviser_reports: adviser_reportsSlice,
announcements: announcementsSlice,
notifications: notificationsSlice,
account_applications: account_applicationsSlice,
guardians: guardiansSlice,
security_events: security_eventsSlice,
support_settings: support_settingsSlice,
feedback_items: feedback_itemsSlice,
events: eventsSlice,
ai_monitoring_rules: ai_monitoring_rulesSlice,
  },
})

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