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 businessesSlice from "./businesses/businessesSlice";
import branchesSlice from "./branches/branchesSlice";
import fiscal_yearsSlice from "./fiscal_years/fiscal_yearsSlice";
import user_role_assignmentsSlice from "./user_role_assignments/user_role_assignmentsSlice";
import app_menusSlice from "./app_menus/app_menusSlice";
import role_permissionsSlice from "./role_permissions/role_permissionsSlice";
import app_settingsSlice from "./app_settings/app_settingsSlice";
import currenciesSlice from "./currencies/currenciesSlice";
import currency_ratesSlice from "./currency_rates/currency_ratesSlice";
import numbering_profilesSlice from "./numbering_profiles/numbering_profilesSlice";
import widgetsSlice from "./widgets/widgetsSlice";
import license_customersSlice from "./license_customers/license_customersSlice";
import license_productsSlice from "./license_products/license_productsSlice";
import license_keysSlice from "./license_keys/license_keysSlice";
import license_activationsSlice from "./license_activations/license_activationsSlice";
import counterpartiesSlice from "./counterparties/counterpartiesSlice";
import cost_centersSlice from "./cost_centers/cost_centersSlice";
import projectsSlice from "./projects/projectsSlice";
import contractsSlice from "./contracts/contractsSlice";
import cash_boxesSlice from "./cash_boxes/cash_boxesSlice";
import banksSlice from "./banks/banksSlice";
import bank_accountsSlice from "./bank_accounts/bank_accountsSlice";
import letters_of_creditSlice from "./letters_of_credit/letters_of_creditSlice";
import pos_terminalsSlice from "./pos_terminals/pos_terminalsSlice";
import sales_item_groupsSlice from "./sales_item_groups/sales_item_groupsSlice";
import warehouse_item_groupsSlice from "./warehouse_item_groups/warehouse_item_groupsSlice";
import customer_groupsSlice from "./customer_groups/customer_groupsSlice";
import analytic_dimensionsSlice from "./analytic_dimensions/analytic_dimensionsSlice";
import accountsSlice from "./accounts/accountsSlice";
import journal_voucher_typesSlice from "./journal_voucher_types/journal_voucher_typesSlice";
import journal_vouchersSlice from "./journal_vouchers/journal_vouchersSlice";
import journal_linesSlice from "./journal_lines/journal_linesSlice";
import approval_workflowsSlice from "./approval_workflows/approval_workflowsSlice";
import workflow_stepsSlice from "./workflow_steps/workflow_stepsSlice";
import voucher_approvalsSlice from "./voucher_approvals/voucher_approvalsSlice";
import year_end_operationsSlice from "./year_end_operations/year_end_operationsSlice";
import report_definitionsSlice from "./report_definitions/report_definitionsSlice";
import report_runsSlice from "./report_runs/report_runsSlice";
import chat_conversationsSlice from "./chat_conversations/chat_conversationsSlice";
import chat_participantsSlice from "./chat_participants/chat_participantsSlice";
import chat_messagesSlice from "./chat_messages/chat_messagesSlice";
import form_alarmsSlice from "./form_alarms/form_alarmsSlice";
import data_export_jobsSlice from "./data_export_jobs/data_export_jobsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
businesses: businessesSlice,
branches: branchesSlice,
fiscal_years: fiscal_yearsSlice,
user_role_assignments: user_role_assignmentsSlice,
app_menus: app_menusSlice,
role_permissions: role_permissionsSlice,
app_settings: app_settingsSlice,
currencies: currenciesSlice,
currency_rates: currency_ratesSlice,
numbering_profiles: numbering_profilesSlice,
widgets: widgetsSlice,
license_customers: license_customersSlice,
license_products: license_productsSlice,
license_keys: license_keysSlice,
license_activations: license_activationsSlice,
counterparties: counterpartiesSlice,
cost_centers: cost_centersSlice,
projects: projectsSlice,
contracts: contractsSlice,
cash_boxes: cash_boxesSlice,
banks: banksSlice,
bank_accounts: bank_accountsSlice,
letters_of_credit: letters_of_creditSlice,
pos_terminals: pos_terminalsSlice,
sales_item_groups: sales_item_groupsSlice,
warehouse_item_groups: warehouse_item_groupsSlice,
customer_groups: customer_groupsSlice,
analytic_dimensions: analytic_dimensionsSlice,
accounts: accountsSlice,
journal_voucher_types: journal_voucher_typesSlice,
journal_vouchers: journal_vouchersSlice,
journal_lines: journal_linesSlice,
approval_workflows: approval_workflowsSlice,
workflow_steps: workflow_stepsSlice,
voucher_approvals: voucher_approvalsSlice,
year_end_operations: year_end_operationsSlice,
report_definitions: report_definitionsSlice,
report_runs: report_runsSlice,
chat_conversations: chat_conversationsSlice,
chat_participants: chat_participantsSlice,
chat_messages: chat_messagesSlice,
form_alarms: form_alarmsSlice,
data_export_jobs: data_export_jobsSlice,
  },
})

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