import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';

import usersSlice from "./users/usersSlice";
import branchesSlice from "./branches/branchesSlice";
import calendarsSlice from "./calendars/calendarsSlice";
import client_statusSlice from "./client_status/client_statusSlice";
import clientsSlice from "./clients/clientsSlice";
import communesSlice from "./communes/communesSlice";
import depositsSlice from "./deposits/depositsSlice";
import districtsSlice from "./districts/districtsSlice";
import document_typeSlice from "./document_type/document_typeSlice";
import expense_itemsSlice from "./expense_items/expense_itemsSlice";
import expense_typesSlice from "./expense_types/expense_typesSlice";
import group_menusSlice from "./group_menus/group_menusSlice";
import guarantorSlice from "./guarantor/guarantorSlice";
import interest_ratesSlice from "./interest_rates/interest_ratesSlice";
import loan_statusSlice from "./loan_status/loan_statusSlice";
import loan_typesSlice from "./loan_types/loan_typesSlice";
import loansSlice from "./loans/loansSlice";
import membersSlice from "./members/membersSlice";
import menusSlice from "./menus/menusSlice";
import payment_revenuesSlice from "./payment_revenues/payment_revenuesSlice";
import payment_statusSlice from "./payment_status/payment_statusSlice";
import payment_transactionsSlice from "./payment_transactions/payment_transactionsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import provincesSlice from "./provinces/provincesSlice";
import sexesSlice from "./sexes/sexesSlice";
import shareholdersSlice from "./shareholders/shareholdersSlice";
import staff_statusSlice from "./staff_status/staff_statusSlice";
import staffsSlice from "./staffs/staffsSlice";
import urlsSlice from "./urls/urlsSlice";
import user_has_menuSlice from "./user_has_menu/user_has_menuSlice";
import user_type_urlsSlice from "./user_type_urls/user_type_urlsSlice";
import user_typesSlice from "./user_types/user_typesSlice";
import villagesSlice from "./villages/villagesSlice";

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

users: usersSlice,
branches: branchesSlice,
calendars: calendarsSlice,
client_status: client_statusSlice,
clients: clientsSlice,
communes: communesSlice,
deposits: depositsSlice,
districts: districtsSlice,
document_type: document_typeSlice,
expense_items: expense_itemsSlice,
expense_types: expense_typesSlice,
group_menus: group_menusSlice,
guarantor: guarantorSlice,
interest_rates: interest_ratesSlice,
loan_status: loan_statusSlice,
loan_types: loan_typesSlice,
loans: loansSlice,
members: membersSlice,
menus: menusSlice,
payment_revenues: payment_revenuesSlice,
payment_status: payment_statusSlice,
payment_transactions: payment_transactionsSlice,
payments: paymentsSlice,
provinces: provincesSlice,
sexes: sexesSlice,
shareholders: shareholdersSlice,
staff_status: staff_statusSlice,
staffs: staffsSlice,
urls: urlsSlice,
user_has_menu: user_has_menuSlice,
user_type_urls: user_type_urlsSlice,
user_types: user_typesSlice,
villages: villagesSlice,
  },
})

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