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 workspacesSlice from "./workspaces/workspacesSlice";
import user_settingsSlice from "./user_settings/user_settingsSlice";
import assistant_profilesSlice from "./assistant_profiles/assistant_profilesSlice";
import conversationsSlice from "./conversations/conversationsSlice";
import messagesSlice from "./messages/messagesSlice";
import voice_sessionsSlice from "./voice_sessions/voice_sessionsSlice";
import tool_providersSlice from "./tool_providers/tool_providersSlice";
import toolsSlice from "./tools/toolsSlice";
import tool_actionsSlice from "./tool_actions/tool_actionsSlice";
import integrationsSlice from "./integrations/integrationsSlice";
import memory_itemsSlice from "./memory_items/memory_itemsSlice";
import tasksSlice from "./tasks/tasksSlice";
import task_stepsSlice from "./task_steps/task_stepsSlice";
import tool_runsSlice from "./tool_runs/tool_runsSlice";
import confirmationsSlice from "./confirmations/confirmationsSlice";
import meetingsSlice from "./meetings/meetingsSlice";
import calendar_eventsSlice from "./calendar_events/calendar_eventsSlice";
import contactsSlice from "./contacts/contactsSlice";
import outbound_messagesSlice from "./outbound_messages/outbound_messagesSlice";
import travel_requestsSlice from "./travel_requests/travel_requestsSlice";
import travel_bookingsSlice from "./travel_bookings/travel_bookingsSlice";
import payment_transactionsSlice from "./payment_transactions/payment_transactionsSlice";
import native_app_checksSlice from "./native_app_checks/native_app_checksSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
workspaces: workspacesSlice,
user_settings: user_settingsSlice,
assistant_profiles: assistant_profilesSlice,
conversations: conversationsSlice,
messages: messagesSlice,
voice_sessions: voice_sessionsSlice,
tool_providers: tool_providersSlice,
tools: toolsSlice,
tool_actions: tool_actionsSlice,
integrations: integrationsSlice,
memory_items: memory_itemsSlice,
tasks: tasksSlice,
task_steps: task_stepsSlice,
tool_runs: tool_runsSlice,
confirmations: confirmationsSlice,
meetings: meetingsSlice,
calendar_events: calendar_eventsSlice,
contacts: contactsSlice,
outbound_messages: outbound_messagesSlice,
travel_requests: travel_requestsSlice,
travel_bookings: travel_bookingsSlice,
payment_transactions: payment_transactionsSlice,
native_app_checks: native_app_checksSlice,
audit_logs: audit_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
