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 skillsSlice from "./skills/skillsSlice";
import service_categoriesSlice from "./service_categories/service_categoriesSlice";
import service_listingsSlice from "./service_listings/service_listingsSlice";
import tagsSlice from "./tags/tagsSlice";
import portfoliosSlice from "./portfolios/portfoliosSlice";
import jobsSlice from "./jobs/jobsSlice";
import job_attachmentsSlice from "./job_attachments/job_attachmentsSlice";
import proposalsSlice from "./proposals/proposalsSlice";
import contractsSlice from "./contracts/contractsSlice";
import milestonesSlice from "./milestones/milestonesSlice";
import deliverablesSlice from "./deliverables/deliverablesSlice";
import conversationsSlice from "./conversations/conversationsSlice";
import messagesSlice from "./messages/messagesSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import invoicesSlice from "./invoices/invoicesSlice";
import reviewsSlice from "./reviews/reviewsSlice";
import disputesSlice from "./disputes/disputesSlice";
import learning_articlesSlice from "./learning_articles/learning_articlesSlice";
import ai_toolsSlice from "./ai_tools/ai_toolsSlice";
import ai_tool_runsSlice from "./ai_tool_runs/ai_tool_runsSlice";
import admin_announcementsSlice from "./admin_announcements/admin_announcementsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
skills: skillsSlice,
service_categories: service_categoriesSlice,
service_listings: service_listingsSlice,
tags: tagsSlice,
portfolios: portfoliosSlice,
jobs: jobsSlice,
job_attachments: job_attachmentsSlice,
proposals: proposalsSlice,
contracts: contractsSlice,
milestones: milestonesSlice,
deliverables: deliverablesSlice,
conversations: conversationsSlice,
messages: messagesSlice,
notifications: notificationsSlice,
payments: paymentsSlice,
invoices: invoicesSlice,
reviews: reviewsSlice,
disputes: disputesSlice,
learning_articles: learning_articlesSlice,
ai_tools: ai_toolsSlice,
ai_tool_runs: ai_tool_runsSlice,
admin_announcements: admin_announcementsSlice,
  },
})

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