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 access_rolesSlice from './access_roles/access_rolesSlice';
import ai_agentsSlice from './ai_agents/ai_agentsSlice';
import alertsSlice from './alerts/alertsSlice';
import automation_jobsSlice from './automation_jobs/automation_jobsSlice';
import campaignsSlice from './campaigns/campaignsSlice';
import compliance_auditsSlice from './compliance_audits/compliance_auditsSlice';
import compliance_issuesSlice from './compliance_issues/compliance_issuesSlice';
import expansion_plansSlice from './expansion_plans/expansion_plansSlice';
import infrastructure_statusesSlice from './infrastructure_statuses/infrastructure_statusesSlice';
import invoicesSlice from './invoices/invoicesSlice';
import market_signalsSlice from './market_signals/market_signalsSlice';
import onboarding_casesSlice from './onboarding_cases/onboarding_casesSlice';
import patient_messagesSlice from './patient_messages/patient_messagesSlice';
import patient_profilesSlice from './patient_profiles/patient_profilesSlice';
import platform_metricsSlice from './platform_metrics/platform_metricsSlice';
import pricing_strategiesSlice from './pricing_strategies/pricing_strategiesSlice';
import revenue_summariesSlice from './revenue_summaries/revenue_summariesSlice';
import subscriber_activitiesSlice from './subscriber_activities/subscriber_activitiesSlice';
import subscriber_rolesSlice from './subscriber_roles/subscriber_rolesSlice';
import subscribersSlice from './subscribers/subscribersSlice';
import support_ticketsSlice from './support_tickets/support_ticketsSlice';
import rolesSlice from './roles/rolesSlice';
import permissionsSlice from './permissions/permissionsSlice';
import organizationsSlice from './organizations/organizationsSlice';

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

    users: usersSlice,
    access_roles: access_rolesSlice,
    ai_agents: ai_agentsSlice,
    alerts: alertsSlice,
    automation_jobs: automation_jobsSlice,
    campaigns: campaignsSlice,
    compliance_audits: compliance_auditsSlice,
    compliance_issues: compliance_issuesSlice,
    expansion_plans: expansion_plansSlice,
    infrastructure_statuses: infrastructure_statusesSlice,
    invoices: invoicesSlice,
    market_signals: market_signalsSlice,
    onboarding_cases: onboarding_casesSlice,
    patient_messages: patient_messagesSlice,
    patient_profiles: patient_profilesSlice,
    platform_metrics: platform_metricsSlice,
    pricing_strategies: pricing_strategiesSlice,
    revenue_summaries: revenue_summariesSlice,
    subscriber_activities: subscriber_activitiesSlice,
    subscriber_roles: subscriber_rolesSlice,
    subscribers: subscribersSlice,
    support_tickets: support_ticketsSlice,
    roles: rolesSlice,
    permissions: permissionsSlice,
    organizations: organizationsSlice,
  },
});

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