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 subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import feature_flagsSlice from "./feature_flags/feature_flagsSlice";
import mattersSlice from "./matters/mattersSlice";
import matter_partiesSlice from "./matter_parties/matter_partiesSlice";
import filesSlice from "./files/filesSlice";
import file_extractionsSlice from "./file_extractions/file_extractionsSlice";
import assistant_threadsSlice from "./assistant_threads/assistant_threadsSlice";
import assistant_messagesSlice from "./assistant_messages/assistant_messagesSlice";
import ai_jobsSlice from "./ai_jobs/ai_jobsSlice";
import legal_templatesSlice from "./legal_templates/legal_templatesSlice";
import template_fieldsSlice from "./template_fields/template_fieldsSlice";
import generated_documentsSlice from "./generated_documents/generated_documentsSlice";
import document_versionsSlice from "./document_versions/document_versionsSlice";
import research_queriesSlice from "./research_queries/research_queriesSlice";
import legal_sourcesSlice from "./legal_sources/legal_sourcesSlice";
import research_resultsSlice from "./research_results/research_resultsSlice";
import citator_checksSlice from "./citator_checks/citator_checksSlice";
import mock_trialsSlice from "./mock_trials/mock_trialsSlice";
import mock_trial_rolesSlice from "./mock_trial_roles/mock_trial_rolesSlice";
import mock_trial_turnsSlice from "./mock_trial_turns/mock_trial_turnsSlice";
import transcription_jobsSlice from "./transcription_jobs/transcription_jobsSlice";
import medical_chronology_reportsSlice from "./medical_chronology_reports/medical_chronology_reportsSlice";
import medical_eventsSlice from "./medical_events/medical_eventsSlice";
import causation_analysesSlice from "./causation_analyses/causation_analysesSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
subscriptions: subscriptionsSlice,
feature_flags: feature_flagsSlice,
matters: mattersSlice,
matter_parties: matter_partiesSlice,
files: filesSlice,
file_extractions: file_extractionsSlice,
assistant_threads: assistant_threadsSlice,
assistant_messages: assistant_messagesSlice,
ai_jobs: ai_jobsSlice,
legal_templates: legal_templatesSlice,
template_fields: template_fieldsSlice,
generated_documents: generated_documentsSlice,
document_versions: document_versionsSlice,
research_queries: research_queriesSlice,
legal_sources: legal_sourcesSlice,
research_results: research_resultsSlice,
citator_checks: citator_checksSlice,
mock_trials: mock_trialsSlice,
mock_trial_roles: mock_trial_rolesSlice,
mock_trial_turns: mock_trial_turnsSlice,
transcription_jobs: transcription_jobsSlice,
medical_chronology_reports: medical_chronology_reportsSlice,
medical_events: medical_eventsSlice,
causation_analyses: causation_analysesSlice,
audit_events: audit_eventsSlice,
  },
})

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