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 academic_yearsSlice from "./academic_years/academic_yearsSlice";
import education_levelsSlice from "./education_levels/education_levelsSlice";
import classesSlice from "./classes/classesSlice";
import studentsSlice from "./students/studentsSlice";
import parent_student_linksSlice from "./parent_student_links/parent_student_linksSlice";
import subjectsSlice from "./subjects/subjectsSlice";
import class_subjectsSlice from "./class_subjects/class_subjectsSlice";
import timetable_entriesSlice from "./timetable_entries/timetable_entriesSlice";
import attendance_sessionsSlice from "./attendance_sessions/attendance_sessionsSlice";
import attendance_recordsSlice from "./attendance_records/attendance_recordsSlice";
import announcementsSlice from "./announcements/announcementsSlice";
import assignmentsSlice from "./assignments/assignmentsSlice";
import assignment_submissionsSlice from "./assignment_submissions/assignment_submissionsSlice";
import exam_categoriesSlice from "./exam_categories/exam_categoriesSlice";
import examsSlice from "./exams/examsSlice";
import exam_questionsSlice from "./exam_questions/exam_questionsSlice";
import exam_question_choicesSlice from "./exam_question_choices/exam_question_choicesSlice";
import exam_attemptsSlice from "./exam_attempts/exam_attemptsSlice";
import exam_answersSlice from "./exam_answers/exam_answersSlice";
import fee_definitionsSlice from "./fee_definitions/fee_definitionsSlice";
import billing_itemsSlice from "./billing_items/billing_itemsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import notification_logsSlice from "./notification_logs/notification_logsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
schools: schoolsSlice,
academic_years: academic_yearsSlice,
education_levels: education_levelsSlice,
classes: classesSlice,
students: studentsSlice,
parent_student_links: parent_student_linksSlice,
subjects: subjectsSlice,
class_subjects: class_subjectsSlice,
timetable_entries: timetable_entriesSlice,
attendance_sessions: attendance_sessionsSlice,
attendance_records: attendance_recordsSlice,
announcements: announcementsSlice,
assignments: assignmentsSlice,
assignment_submissions: assignment_submissionsSlice,
exam_categories: exam_categoriesSlice,
exams: examsSlice,
exam_questions: exam_questionsSlice,
exam_question_choices: exam_question_choicesSlice,
exam_attempts: exam_attemptsSlice,
exam_answers: exam_answersSlice,
fee_definitions: fee_definitionsSlice,
billing_items: billing_itemsSlice,
payments: paymentsSlice,
notification_logs: notification_logsSlice,
  },
})

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