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 companiesSlice from "./companies/companiesSlice";
import business_unitsSlice from "./business_units/business_unitsSlice";
import tagsSlice from "./tags/tagsSlice";
import assetsSlice from "./assets/assetsSlice";
import tenantsSlice from "./tenants/tenantsSlice";
import leasesSlice from "./leases/leasesSlice";
import work_ordersSlice from "./work_orders/work_ordersSlice";
import productsSlice from "./products/productsSlice";
import warehousesSlice from "./warehouses/warehousesSlice";
import inventory_itemsSlice from "./inventory_items/inventory_itemsSlice";
import inventory_transactionsSlice from "./inventory_transactions/inventory_transactionsSlice";
import customersSlice from "./customers/customersSlice";
import sales_ordersSlice from "./sales_orders/sales_ordersSlice";
import sales_order_linesSlice from "./sales_order_lines/sales_order_linesSlice";
import invoicesSlice from "./invoices/invoicesSlice";
import paymentsSlice from "./payments/paymentsSlice";
import crm_pipelinesSlice from "./crm_pipelines/crm_pipelinesSlice";
import crm_stagesSlice from "./crm_stages/crm_stagesSlice";
import leadsSlice from "./leads/leadsSlice";
import activitiesSlice from "./activities/activitiesSlice";
import content_foldersSlice from "./content_folders/content_foldersSlice";
import content_itemsSlice from "./content_items/content_itemsSlice";
import seo_keywordsSlice from "./seo_keywords/seo_keywordsSlice";
import content_campaignsSlice from "./content_campaigns/content_campaignsSlice";
import dashboardsSlice from "./dashboards/dashboardsSlice";
import reportsSlice from "./reports/reportsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
companies: companiesSlice,
business_units: business_unitsSlice,
tags: tagsSlice,
assets: assetsSlice,
tenants: tenantsSlice,
leases: leasesSlice,
work_orders: work_ordersSlice,
products: productsSlice,
warehouses: warehousesSlice,
inventory_items: inventory_itemsSlice,
inventory_transactions: inventory_transactionsSlice,
customers: customersSlice,
sales_orders: sales_ordersSlice,
sales_order_lines: sales_order_linesSlice,
invoices: invoicesSlice,
payments: paymentsSlice,
crm_pipelines: crm_pipelinesSlice,
crm_stages: crm_stagesSlice,
leads: leadsSlice,
activities: activitiesSlice,
content_folders: content_foldersSlice,
content_items: content_itemsSlice,
seo_keywords: seo_keywordsSlice,
content_campaigns: content_campaignsSlice,
dashboards: dashboardsSlice,
reports: reportsSlice,
  },
})

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