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 school_settingsSlice from "./school_settings/school_settingsSlice";
import pagesSlice from "./pages/pagesSlice";
import school_yearsSlice from "./school_years/school_yearsSlice";
import gradesSlice from "./grades/gradesSlice";
import streamsSlice from "./streams/streamsSlice";
import subjectsSlice from "./subjects/subjectsSlice";
import subject_offeringsSlice from "./subject_offerings/subject_offeringsSlice";
import staff_membersSlice from "./staff_members/staff_membersSlice";
import studentsSlice from "./students/studentsSlice";
import class_sectionsSlice from "./class_sections/class_sectionsSlice";
import enrollmentsSlice from "./enrollments/enrollmentsSlice";
import termsSlice from "./terms/termsSlice";
import eventsSlice from "./events/eventsSlice";
import announcementsSlice from "./announcements/announcementsSlice";
import news_postsSlice from "./news_posts/news_postsSlice";
import galleriesSlice from "./galleries/galleriesSlice";
import study_materialsSlice from "./study_materials/study_materialsSlice";
import examsSlice from "./exams/examsSlice";
import exam_resultsSlice from "./exam_results/exam_resultsSlice";
import attendance_sessionsSlice from "./attendance_sessions/attendance_sessionsSlice";
import attendance_recordsSlice from "./attendance_records/attendance_recordsSlice";
import class_schedulesSlice from "./class_schedules/class_schedulesSlice";
import assignmentsSlice from "./assignments/assignmentsSlice";
import assignment_submissionsSlice from "./assignment_submissions/assignment_submissionsSlice";
import lesson_plansSlice from "./lesson_plans/lesson_plansSlice";
import messagesSlice from "./messages/messagesSlice";
import admission_applicationsSlice from "./admission_applications/admission_applicationsSlice";
import contact_messagesSlice from "./contact_messages/contact_messagesSlice";
import alumniSlice from "./alumni/alumniSlice";
import school_statisticsSlice from "./school_statistics/school_statisticsSlice";
import exam_performance_summariesSlice from "./exam_performance_summaries/exam_performance_summariesSlice";
import top_student_featuresSlice from "./top_student_features/top_student_featuresSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
school_settings: school_settingsSlice,
pages: pagesSlice,
school_years: school_yearsSlice,
grades: gradesSlice,
streams: streamsSlice,
subjects: subjectsSlice,
subject_offerings: subject_offeringsSlice,
staff_members: staff_membersSlice,
students: studentsSlice,
class_sections: class_sectionsSlice,
enrollments: enrollmentsSlice,
terms: termsSlice,
events: eventsSlice,
announcements: announcementsSlice,
news_posts: news_postsSlice,
galleries: galleriesSlice,
study_materials: study_materialsSlice,
exams: examsSlice,
exam_results: exam_resultsSlice,
attendance_sessions: attendance_sessionsSlice,
attendance_records: attendance_recordsSlice,
class_schedules: class_schedulesSlice,
assignments: assignmentsSlice,
assignment_submissions: assignment_submissionsSlice,
lesson_plans: lesson_plansSlice,
messages: messagesSlice,
admission_applications: admission_applicationsSlice,
contact_messages: contact_messagesSlice,
alumni: alumniSlice,
school_statistics: school_statisticsSlice,
exam_performance_summaries: exam_performance_summariesSlice,
top_student_features: top_student_featuresSlice,
  },
})

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