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_invitationsSlice from "./user_invitations/user_invitationsSlice";
import connected_systemsSlice from "./connected_systems/connected_systemsSlice";
import control_frameworksSlice from "./control_frameworks/control_frameworksSlice";
import control_requirementsSlice from "./control_requirements/control_requirementsSlice";
import identity_workflowsSlice from "./identity_workflows/identity_workflowsSlice";
import evidence_modelsSlice from "./evidence_models/evidence_modelsSlice";
import artifactsSlice from "./artifacts/artifactsSlice";
import sampled_subjectsSlice from "./sampled_subjects/sampled_subjectsSlice";
import proof_packetsSlice from "./proof_packets/proof_packetsSlice";
import remediation_itemsSlice from "./remediation_items/remediation_itemsSlice";
import access_reviewsSlice from "./access_reviews/access_reviewsSlice";
import access_review_itemsSlice from "./access_review_items/access_review_itemsSlice";
import exceptionsSlice from "./exceptions/exceptionsSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import organization_settingsSlice from "./organization_settings/organization_settingsSlice";
import artifact_type_catalogSlice from "./artifact_type_catalog/artifact_type_catalogSlice";
import workflow_templatesSlice from "./workflow_templates/workflow_templatesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
user_invitations: user_invitationsSlice,
connected_systems: connected_systemsSlice,
control_frameworks: control_frameworksSlice,
control_requirements: control_requirementsSlice,
identity_workflows: identity_workflowsSlice,
evidence_models: evidence_modelsSlice,
artifacts: artifactsSlice,
sampled_subjects: sampled_subjectsSlice,
proof_packets: proof_packetsSlice,
remediation_items: remediation_itemsSlice,
access_reviews: access_reviewsSlice,
access_review_items: access_review_itemsSlice,
exceptions: exceptionsSlice,
audit_logs: audit_logsSlice,
notifications: notificationsSlice,
organization_settings: organization_settingsSlice,
artifact_type_catalog: artifact_type_catalogSlice,
workflow_templates: workflow_templatesSlice,
  },
})

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