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 teamsSlice from "./teams/teamsSlice";
import oauth_accountsSlice from "./oauth_accounts/oauth_accountsSlice";
import integrationsSlice from "./integrations/integrationsSlice";
import user_storiesSlice from "./user_stories/user_storiesSlice";
import acceptance_criteriaSlice from "./acceptance_criteria/acceptance_criteriaSlice";
import documentsSlice from "./documents/documentsSlice";
import document_foldersSlice from "./document_folders/document_foldersSlice";
import document_versionsSlice from "./document_versions/document_versionsSlice";
import story_document_linksSlice from "./story_document_links/story_document_linksSlice";
import collaboration_sessionsSlice from "./collaboration_sessions/collaboration_sessionsSlice";
import comment_threadsSlice from "./comment_threads/comment_threadsSlice";
import commentsSlice from "./comments/commentsSlice";
import comment_reactionsSlice from "./comment_reactions/comment_reactionsSlice";
import mentionsSlice from "./mentions/mentionsSlice";
import approval_workflowsSlice from "./approval_workflows/approval_workflowsSlice";
import approvalsSlice from "./approvals/approvalsSlice";
import approval_reviewersSlice from "./approval_reviewers/approval_reviewersSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import sprintsSlice from "./sprints/sprintsSlice";
import sprint_itemsSlice from "./sprint_items/sprint_itemsSlice";
import blockersSlice from "./blockers/blockersSlice";
import activity_feed_itemsSlice from "./activity_feed_items/activity_feed_itemsSlice";
import ai_generationsSlice from "./ai_generations/ai_generationsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
teams: teamsSlice,
oauth_accounts: oauth_accountsSlice,
integrations: integrationsSlice,
user_stories: user_storiesSlice,
acceptance_criteria: acceptance_criteriaSlice,
documents: documentsSlice,
document_folders: document_foldersSlice,
document_versions: document_versionsSlice,
story_document_links: story_document_linksSlice,
collaboration_sessions: collaboration_sessionsSlice,
comment_threads: comment_threadsSlice,
comments: commentsSlice,
comment_reactions: comment_reactionsSlice,
mentions: mentionsSlice,
approval_workflows: approval_workflowsSlice,
approvals: approvalsSlice,
approval_reviewers: approval_reviewersSlice,
audit_events: audit_eventsSlice,
notifications: notificationsSlice,
sprints: sprintsSlice,
sprint_items: sprint_itemsSlice,
blockers: blockersSlice,
activity_feed_items: activity_feed_itemsSlice,
ai_generations: ai_generationsSlice,
  },
})

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