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 locationsSlice from "./locations/locationsSlice";
import role_assignmentsSlice from "./role_assignments/role_assignmentsSlice";
import payersSlice from "./payers/payersSlice";
import payer_plansSlice from "./payer_plans/payer_plansSlice";
import procedure_familiesSlice from "./procedure_families/procedure_familiesSlice";
import cpt_codesSlice from "./cpt_codes/cpt_codesSlice";
import patientsSlice from "./patients/patientsSlice";
import authorization_casesSlice from "./authorization_cases/authorization_casesSlice";
import case_documentsSlice from "./case_documents/case_documentsSlice";
import submissionsSlice from "./submissions/submissionsSlice";
import submission_eventsSlice from "./submission_events/submission_eventsSlice";
import tasksSlice from "./tasks/tasksSlice";
import denialsSlice from "./denials/denialsSlice";
import appealsSlice from "./appeals/appealsSlice";
import templatesSlice from "./templates/templatesSlice";
import payer_rulesSlice from "./payer_rules/payer_rulesSlice";
import rule_requirementsSlice from "./rule_requirements/rule_requirementsSlice";
import ai_jobsSlice from "./ai_jobs/ai_jobsSlice";
import ai_outputsSlice from "./ai_outputs/ai_outputsSlice";
import review_actionsSlice from "./review_actions/review_actionsSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import integration_endpointsSlice from "./integration_endpoints/integration_endpointsSlice";
import contactsSlice from "./contacts/contactsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
locations: locationsSlice,
role_assignments: role_assignmentsSlice,
payers: payersSlice,
payer_plans: payer_plansSlice,
procedure_families: procedure_familiesSlice,
cpt_codes: cpt_codesSlice,
patients: patientsSlice,
authorization_cases: authorization_casesSlice,
case_documents: case_documentsSlice,
submissions: submissionsSlice,
submission_events: submission_eventsSlice,
tasks: tasksSlice,
denials: denialsSlice,
appeals: appealsSlice,
templates: templatesSlice,
payer_rules: payer_rulesSlice,
rule_requirements: rule_requirementsSlice,
ai_jobs: ai_jobsSlice,
ai_outputs: ai_outputsSlice,
review_actions: review_actionsSlice,
audit_logs: audit_logsSlice,
integration_endpoints: integration_endpointsSlice,
contacts: contactsSlice,
  },
})

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