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 api_providersSlice from "./api_providers/api_providersSlice";
import market_symbolsSlice from "./market_symbols/market_symbolsSlice";
import symbol_fundamentalsSlice from "./symbol_fundamentals/symbol_fundamentalsSlice";
import price_quotesSlice from "./price_quotes/price_quotesSlice";
import technical_indicatorsSlice from "./technical_indicators/technical_indicatorsSlice";
import analyst_ratingsSlice from "./analyst_ratings/analyst_ratingsSlice";
import earnings_reportsSlice from "./earnings_reports/earnings_reportsSlice";
import news_articlesSlice from "./news_articles/news_articlesSlice";
import news_article_symbolsSlice from "./news_article_symbols/news_article_symbolsSlice";
import article_bookmarksSlice from "./article_bookmarks/article_bookmarksSlice";
import watchlistsSlice from "./watchlists/watchlistsSlice";
import watchlist_itemsSlice from "./watchlist_items/watchlist_itemsSlice";
import paper_accountsSlice from "./paper_accounts/paper_accountsSlice";
import paper_ordersSlice from "./paper_orders/paper_ordersSlice";
import paper_tradesSlice from "./paper_trades/paper_tradesSlice";
import paper_positionsSlice from "./paper_positions/paper_positionsSlice";
import portfolio_snapshotsSlice from "./portfolio_snapshots/portfolio_snapshotsSlice";
import screener_filtersSlice from "./screener_filters/screener_filtersSlice";
import screener_runsSlice from "./screener_runs/screener_runsSlice";
import screener_resultsSlice from "./screener_results/screener_resultsSlice";
import ai_chat_sessionsSlice from "./ai_chat_sessions/ai_chat_sessionsSlice";
import ai_messagesSlice from "./ai_messages/ai_messagesSlice";
import learning_modulesSlice from "./learning_modules/learning_modulesSlice";
import user_tooltipsSlice from "./user_tooltips/user_tooltipsSlice";
import ir_companiesSlice from "./ir_companies/ir_companiesSlice";
import ir_management_membersSlice from "./ir_management_members/ir_management_membersSlice";
import ir_filingsSlice from "./ir_filings/ir_filingsSlice";
import ir_dividendsSlice from "./ir_dividends/ir_dividendsSlice";
import ir_announcementsSlice from "./ir_announcements/ir_announcementsSlice";
import ir_financial_statement_summariesSlice from "./ir_financial_statement_summaries/ir_financial_statement_summariesSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
api_providers: api_providersSlice,
market_symbols: market_symbolsSlice,
symbol_fundamentals: symbol_fundamentalsSlice,
price_quotes: price_quotesSlice,
technical_indicators: technical_indicatorsSlice,
analyst_ratings: analyst_ratingsSlice,
earnings_reports: earnings_reportsSlice,
news_articles: news_articlesSlice,
news_article_symbols: news_article_symbolsSlice,
article_bookmarks: article_bookmarksSlice,
watchlists: watchlistsSlice,
watchlist_items: watchlist_itemsSlice,
paper_accounts: paper_accountsSlice,
paper_orders: paper_ordersSlice,
paper_trades: paper_tradesSlice,
paper_positions: paper_positionsSlice,
portfolio_snapshots: portfolio_snapshotsSlice,
screener_filters: screener_filtersSlice,
screener_runs: screener_runsSlice,
screener_results: screener_resultsSlice,
ai_chat_sessions: ai_chat_sessionsSlice,
ai_messages: ai_messagesSlice,
learning_modules: learning_modulesSlice,
user_tooltips: user_tooltipsSlice,
ir_companies: ir_companiesSlice,
ir_management_members: ir_management_membersSlice,
ir_filings: ir_filingsSlice,
ir_dividends: ir_dividendsSlice,
ir_announcements: ir_announcementsSlice,
ir_financial_statement_summaries: ir_financial_statement_summariesSlice,
audit_events: audit_eventsSlice,
  },
})

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