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 outletsSlice from "./outlets/outletsSlice";
import job_positionsSlice from "./job_positions/job_positionsSlice";
import employeesSlice from "./employees/employeesSlice";
import employee_contractsSlice from "./employee_contracts/employee_contractsSlice";
import attendance_logsSlice from "./attendance_logs/attendance_logsSlice";
import attendance_requestsSlice from "./attendance_requests/attendance_requestsSlice";
import overtime_logsSlice from "./overtime_logs/overtime_logsSlice";
import disciplinary_actionsSlice from "./disciplinary_actions/disciplinary_actionsSlice";
import kpi_periodsSlice from "./kpi_periods/kpi_periodsSlice";
import kpi_scoresSlice from "./kpi_scores/kpi_scoresSlice";
import outlet_revenuesSlice from "./outlet_revenues/outlet_revenuesSlice";
import service_charge_poolsSlice from "./service_charge_pools/service_charge_poolsSlice";
import loan_accountsSlice from "./loan_accounts/loan_accountsSlice";
import payroll_periodsSlice from "./payroll_periods/payroll_periodsSlice";
import payroll_itemsSlice from "./payroll_items/payroll_itemsSlice";
import payroll_adjustmentsSlice from "./payroll_adjustments/payroll_adjustmentsSlice";
import payslipsSlice from "./payslips/payslipsSlice";
import notification_messagesSlice from "./notification_messages/notification_messagesSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
outlets: outletsSlice,
job_positions: job_positionsSlice,
employees: employeesSlice,
employee_contracts: employee_contractsSlice,
attendance_logs: attendance_logsSlice,
attendance_requests: attendance_requestsSlice,
overtime_logs: overtime_logsSlice,
disciplinary_actions: disciplinary_actionsSlice,
kpi_periods: kpi_periodsSlice,
kpi_scores: kpi_scoresSlice,
outlet_revenues: outlet_revenuesSlice,
service_charge_pools: service_charge_poolsSlice,
loan_accounts: loan_accountsSlice,
payroll_periods: payroll_periodsSlice,
payroll_items: payroll_itemsSlice,
payroll_adjustments: payroll_adjustmentsSlice,
payslips: payslipsSlice,
notification_messages: notification_messagesSlice,
audit_logs: audit_logsSlice,
  },
})

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