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 trust_profilesSlice from "./trust_profiles/trust_profilesSlice";
import identity_verificationsSlice from "./identity_verifications/identity_verificationsSlice";
import walletsSlice from "./wallets/walletsSlice";
import wallet_transactionsSlice from "./wallet_transactions/wallet_transactionsSlice";
import chatsSlice from "./chats/chatsSlice";
import chat_participantsSlice from "./chat_participants/chat_participantsSlice";
import messagesSlice from "./messages/messagesSlice";
import storesSlice from "./stores/storesSlice";
import addressesSlice from "./addresses/addressesSlice";
import product_categoriesSlice from "./product_categories/product_categoriesSlice";
import productsSlice from "./products/productsSlice";
import ordersSlice from "./orders/ordersSlice";
import order_itemsSlice from "./order_items/order_itemsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import product_reviewsSlice from "./product_reviews/product_reviewsSlice";
import shipmentsSlice from "./shipments/shipmentsSlice";
import postsSlice from "./posts/postsSlice";
import deep_dive_linksSlice from "./deep_dive_links/deep_dive_linksSlice";
import citationsSlice from "./citations/citationsSlice";
import post_engagementsSlice from "./post_engagements/post_engagementsSlice";
import rewardsSlice from "./rewards/rewardsSlice";
import forum_spacesSlice from "./forum_spaces/forum_spacesSlice";
import forum_threadsSlice from "./forum_threads/forum_threadsSlice";
import forum_postsSlice from "./forum_posts/forum_postsSlice";
import job_companiesSlice from "./job_companies/job_companiesSlice";
import job_listingsSlice from "./job_listings/job_listingsSlice";
import job_applicationsSlice from "./job_applications/job_applicationsSlice";
import user_credentialsSlice from "./user_credentials/user_credentialsSlice";
import affiliate_programsSlice from "./affiliate_programs/affiliate_programsSlice";
import affiliate_membershipsSlice from "./affiliate_memberships/affiliate_membershipsSlice";
import commissionsSlice from "./commissions/commissionsSlice";
import geo_rulesSlice from "./geo_rules/geo_rulesSlice";
import facta_queriesSlice from "./facta_queries/facta_queriesSlice";
import facta_answersSlice from "./facta_answers/facta_answersSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import api_clientsSlice from "./api_clients/api_clientsSlice";
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,
organizations: organizationsSlice,
trust_profiles: trust_profilesSlice,
identity_verifications: identity_verificationsSlice,
wallets: walletsSlice,
wallet_transactions: wallet_transactionsSlice,
chats: chatsSlice,
chat_participants: chat_participantsSlice,
messages: messagesSlice,
stores: storesSlice,
addresses: addressesSlice,
product_categories: product_categoriesSlice,
products: productsSlice,
orders: ordersSlice,
order_items: order_itemsSlice,
payments: paymentsSlice,
product_reviews: product_reviewsSlice,
shipments: shipmentsSlice,
posts: postsSlice,
deep_dive_links: deep_dive_linksSlice,
citations: citationsSlice,
post_engagements: post_engagementsSlice,
rewards: rewardsSlice,
forum_spaces: forum_spacesSlice,
forum_threads: forum_threadsSlice,
forum_posts: forum_postsSlice,
job_companies: job_companiesSlice,
job_listings: job_listingsSlice,
job_applications: job_applicationsSlice,
user_credentials: user_credentialsSlice,
affiliate_programs: affiliate_programsSlice,
affiliate_memberships: affiliate_membershipsSlice,
commissions: commissionsSlice,
geo_rules: geo_rulesSlice,
facta_queries: facta_queriesSlice,
facta_answers: facta_answersSlice,
subscriptions: subscriptionsSlice,
api_clients: api_clientsSlice,
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
