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 brandsSlice from "./brands/brandsSlice";
import brand_voice_profilesSlice from "./brand_voice_profiles/brand_voice_profilesSlice";
import brain_profilesSlice from "./brain_profiles/brain_profilesSlice";
import skill_modulesSlice from "./skill_modules/skill_modulesSlice";
import six_hat_sessionsSlice from "./six_hat_sessions/six_hat_sessionsSlice";
import knowledge_sourcesSlice from "./knowledge_sources/knowledge_sourcesSlice";
import knowledge_documentsSlice from "./knowledge_documents/knowledge_documentsSlice";
import knowledge_chunksSlice from "./knowledge_chunks/knowledge_chunksSlice";
import knowledge_nodesSlice from "./knowledge_nodes/knowledge_nodesSlice";
import campaignsSlice from "./campaigns/campaignsSlice";
import campaign_brain_configsSlice from "./campaign_brain_configs/campaign_brain_configsSlice";
import safety_policiesSlice from "./safety_policies/safety_policiesSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";
import ad_projectsSlice from "./ad_projects/ad_projectsSlice";
import ad_creativesSlice from "./ad_creatives/ad_creativesSlice";
import generation_runsSlice from "./generation_runs/generation_runsSlice";
import generation_outputsSlice from "./generation_outputs/generation_outputsSlice";
import output_citationsSlice from "./output_citations/output_citationsSlice";
import feedback_entriesSlice from "./feedback_entries/feedback_entriesSlice";
import learning_signalsSlice from "./learning_signals/learning_signalsSlice";
import platform_metricsSlice from "./platform_metrics/platform_metricsSlice";
import sandbox_scenariosSlice from "./sandbox_scenarios/sandbox_scenariosSlice";
import refresh_jobsSlice from "./refresh_jobs/refresh_jobsSlice";
import approval_reviewsSlice from "./approval_reviews/approval_reviewsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
brands: brandsSlice,
brand_voice_profiles: brand_voice_profilesSlice,
brain_profiles: brain_profilesSlice,
skill_modules: skill_modulesSlice,
six_hat_sessions: six_hat_sessionsSlice,
knowledge_sources: knowledge_sourcesSlice,
knowledge_documents: knowledge_documentsSlice,
knowledge_chunks: knowledge_chunksSlice,
knowledge_nodes: knowledge_nodesSlice,
campaigns: campaignsSlice,
campaign_brain_configs: campaign_brain_configsSlice,
safety_policies: safety_policiesSlice,
audit_events: audit_eventsSlice,
ad_projects: ad_projectsSlice,
ad_creatives: ad_creativesSlice,
generation_runs: generation_runsSlice,
generation_outputs: generation_outputsSlice,
output_citations: output_citationsSlice,
feedback_entries: feedback_entriesSlice,
learning_signals: learning_signalsSlice,
platform_metrics: platform_metricsSlice,
sandbox_scenarios: sandbox_scenariosSlice,
refresh_jobs: refresh_jobsSlice,
approval_reviews: approval_reviewsSlice,
  },
})

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