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 customersSlice from "./customers/customersSlice";
import vehiclesSlice from "./vehicles/vehiclesSlice";
import pay_typesSlice from "./pay_types/pay_typesSlice";
import employee_pay_typesSlice from "./employee_pay_types/employee_pay_typesSlice";
import chemical_productsSlice from "./chemical_products/chemical_productsSlice";
import job_logsSlice from "./job_logs/job_logsSlice";
import job_chemical_usagesSlice from "./job_chemical_usages/job_chemical_usagesSlice";
import payroll_runsSlice from "./payroll_runs/payroll_runsSlice";
import payroll_line_itemsSlice from "./payroll_line_items/payroll_line_itemsSlice";
import workers_comp_classesSlice from "./workers_comp_classes/workers_comp_classesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
customers: customersSlice,
vehicles: vehiclesSlice,
pay_types: pay_typesSlice,
employee_pay_types: employee_pay_typesSlice,
chemical_products: chemical_productsSlice,
job_logs: job_logsSlice,
job_chemical_usages: job_chemical_usagesSlice,
payroll_runs: payroll_runsSlice,
payroll_line_items: payroll_line_itemsSlice,
workers_comp_classes: workers_comp_classesSlice,
  },
})

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