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 tutor_profilesSlice from "./tutor_profiles/tutor_profilesSlice";
import learner_profilesSlice from "./learner_profiles/learner_profilesSlice";
import subject_categoriesSlice from "./subject_categories/subject_categoriesSlice";
import subjectsSlice from "./subjects/subjectsSlice";
import languagesSlice from "./languages/languagesSlice";
import gigsSlice from "./gigs/gigsSlice";
import gig_levelsSlice from "./gig_levels/gig_levelsSlice";
import tagsSlice from "./tags/tagsSlice";
import bookingsSlice from "./bookings/bookingsSlice";
import conversationsSlice from "./conversations/conversationsSlice";
import messagesSlice from "./messages/messagesSlice";
import reviewsSlice from "./reviews/reviewsSlice";
import notesSlice from "./notes/notesSlice";
import disputesSlice from "./disputes/disputesSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import platform_configSlice from "./platform_config/platform_configSlice";
import admin_audit_logsSlice from "./admin_audit_logs/admin_audit_logsSlice";
import user_login_historySlice from "./user_login_history/user_login_historySlice";
import invitesSlice from "./invites/invitesSlice";
import spacesSlice from "./spaces/spacesSlice";
import space_membershipsSlice from "./space_memberships/space_membershipsSlice";
import community_postsSlice from "./community_posts/community_postsSlice";
import community_commentsSlice from "./community_comments/community_commentsSlice";
import community_reactionsSlice from "./community_reactions/community_reactionsSlice";
import community_reportsSlice from "./community_reports/community_reportsSlice";
import weekly_challengesSlice from "./weekly_challenges/weekly_challengesSlice";
import challenge_participationsSlice from "./challenge_participations/challenge_participationsSlice";
import user_gamificationSlice from "./user_gamification/user_gamificationSlice";
import badgesSlice from "./badges/badgesSlice";
import user_badgesSlice from "./user_badges/user_badgesSlice";
import study_groupsSlice from "./study_groups/study_groupsSlice";
import study_group_membershipsSlice from "./study_group_memberships/study_group_membershipsSlice";
import study_group_postsSlice from "./study_group_posts/study_group_postsSlice";
import study_group_messagesSlice from "./study_group_messages/study_group_messagesSlice";
import study_group_resourcesSlice from "./study_group_resources/study_group_resourcesSlice";
import live_eventsSlice from "./live_events/live_eventsSlice";
import event_rsvpsSlice from "./event_rsvps/event_rsvpsSlice";
import certificatesSlice from "./certificates/certificatesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
tutor_profiles: tutor_profilesSlice,
learner_profiles: learner_profilesSlice,
subject_categories: subject_categoriesSlice,
subjects: subjectsSlice,
languages: languagesSlice,
gigs: gigsSlice,
gig_levels: gig_levelsSlice,
tags: tagsSlice,
bookings: bookingsSlice,
conversations: conversationsSlice,
messages: messagesSlice,
reviews: reviewsSlice,
notes: notesSlice,
disputes: disputesSlice,
notifications: notificationsSlice,
platform_config: platform_configSlice,
admin_audit_logs: admin_audit_logsSlice,
user_login_history: user_login_historySlice,
invites: invitesSlice,
spaces: spacesSlice,
space_memberships: space_membershipsSlice,
community_posts: community_postsSlice,
community_comments: community_commentsSlice,
community_reactions: community_reactionsSlice,
community_reports: community_reportsSlice,
weekly_challenges: weekly_challengesSlice,
challenge_participations: challenge_participationsSlice,
user_gamification: user_gamificationSlice,
badges: badgesSlice,
user_badges: user_badgesSlice,
study_groups: study_groupsSlice,
study_group_memberships: study_group_membershipsSlice,
study_group_posts: study_group_postsSlice,
study_group_messages: study_group_messagesSlice,
study_group_resources: study_group_resourcesSlice,
live_events: live_eventsSlice,
event_rsvps: event_rsvpsSlice,
certificates: certificatesSlice,
  },
})

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