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 user_profilesSlice from "./user_profiles/user_profilesSlice";
import user_profile_typesSlice from "./user_profile_types/user_profile_typesSlice";
import declarationsSlice from "./declarations/declarationsSlice";
import dependentsSlice from "./dependents/dependentsSlice";
import data_sourcesSlice from "./data_sources/data_sourcesSlice";
import transactionsSlice from "./transactions/transactionsSlice";
import documentsSlice from "./documents/documentsSlice";
import income_payers_pjSlice from "./income_payers_pj/income_payers_pjSlice";
import income_carne_leao_monthlySlice from "./income_carne_leao_monthly/income_carne_leao_monthlySlice";
import exempt_incomesSlice from "./exempt_incomes/exempt_incomesSlice";
import exclusive_incomesSlice from "./exclusive_incomes/exclusive_incomesSlice";
import assetsSlice from "./assets/assetsSlice";
import debtsSlice from "./debts/debtsSlice";
import deductible_paymentsSlice from "./deductible_payments/deductible_paymentsSlice";
import investment_positionsSlice from "./investment_positions/investment_positionsSlice";
import tradesSlice from "./trades/tradesSlice";
import monthly_capital_gainsSlice from "./monthly_capital_gains/monthly_capital_gainsSlice";
import risk_analysesSlice from "./risk_analyses/risk_analysesSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import organization_membershipsSlice from "./organization_memberships/organization_membershipsSlice";
import accountant_client_accessesSlice from "./accountant_client_accesses/accountant_client_accessesSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import consentsSlice from "./consents/consentsSlice";
import job_runsSlice from "./job_runs/job_runsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
user_profiles: user_profilesSlice,
user_profile_types: user_profile_typesSlice,
declarations: declarationsSlice,
dependents: dependentsSlice,
data_sources: data_sourcesSlice,
transactions: transactionsSlice,
documents: documentsSlice,
income_payers_pj: income_payers_pjSlice,
income_carne_leao_monthly: income_carne_leao_monthlySlice,
exempt_incomes: exempt_incomesSlice,
exclusive_incomes: exclusive_incomesSlice,
assets: assetsSlice,
debts: debtsSlice,
deductible_payments: deductible_paymentsSlice,
investment_positions: investment_positionsSlice,
trades: tradesSlice,
monthly_capital_gains: monthly_capital_gainsSlice,
risk_analyses: risk_analysesSlice,
notifications: notificationsSlice,
organization_memberships: organization_membershipsSlice,
accountant_client_accesses: accountant_client_accessesSlice,
audit_logs: audit_logsSlice,
consents: consentsSlice,
job_runs: job_runsSlice,
  },
})

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