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 oauth_accountsSlice from "./oauth_accounts/oauth_accountsSlice";
import artist_profilesSlice from "./artist_profiles/artist_profilesSlice";
import teamsSlice from "./teams/teamsSlice";
import team_membershipsSlice from "./team_memberships/team_membershipsSlice";
import plansSlice from "./plans/plansSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import distribution_platformsSlice from "./distribution_platforms/distribution_platformsSlice";
import genresSlice from "./genres/genresSlice";
import releasesSlice from "./releases/releasesSlice";
import tracksSlice from "./tracks/tracksSlice";
import track_contributorsSlice from "./track_contributors/track_contributorsSlice";
import release_deliveriesSlice from "./release_deliveries/release_deliveriesSlice";
import smart_linksSlice from "./smart_links/smart_linksSlice";
import smart_link_destinationsSlice from "./smart_link_destinations/smart_link_destinationsSlice";
import smart_link_clicksSlice from "./smart_link_clicks/smart_link_clicksSlice";
import playlistsSlice from "./playlists/playlistsSlice";
import pitch_requestsSlice from "./pitch_requests/pitch_requestsSlice";
import playlist_placementsSlice from "./playlist_placements/playlist_placementsSlice";
import royalty_reportsSlice from "./royalty_reports/royalty_reportsSlice";
import royalty_linesSlice from "./royalty_lines/royalty_linesSlice";
import walletsSlice from "./wallets/walletsSlice";
import wallet_transactionsSlice from "./wallet_transactions/wallet_transactionsSlice";
import payout_methodsSlice from "./payout_methods/payout_methodsSlice";
import withdrawal_requestsSlice from "./withdrawal_requests/withdrawal_requestsSlice";
import tax_documentsSlice from "./tax_documents/tax_documentsSlice";
import analytics_dailySlice from "./analytics_daily/analytics_dailySlice";
import notificationsSlice from "./notifications/notificationsSlice";
import notification_preferencesSlice from "./notification_preferences/notification_preferencesSlice";
import api_keysSlice from "./api_keys/api_keysSlice";
import dashboard_widgetsSlice from "./dashboard_widgets/dashboard_widgetsSlice";
import activity_eventsSlice from "./activity_events/activity_eventsSlice";
import blog_postsSlice from "./blog_posts/blog_postsSlice";
import faq_itemsSlice from "./faq_items/faq_itemsSlice";
import contact_messagesSlice from "./contact_messages/contact_messagesSlice";
import referral_programsSlice from "./referral_programs/referral_programsSlice";
import referral_linksSlice from "./referral_links/referral_linksSlice";
import referral_conversionsSlice from "./referral_conversions/referral_conversionsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
oauth_accounts: oauth_accountsSlice,
artist_profiles: artist_profilesSlice,
teams: teamsSlice,
team_memberships: team_membershipsSlice,
plans: plansSlice,
subscriptions: subscriptionsSlice,
distribution_platforms: distribution_platformsSlice,
genres: genresSlice,
releases: releasesSlice,
tracks: tracksSlice,
track_contributors: track_contributorsSlice,
release_deliveries: release_deliveriesSlice,
smart_links: smart_linksSlice,
smart_link_destinations: smart_link_destinationsSlice,
smart_link_clicks: smart_link_clicksSlice,
playlists: playlistsSlice,
pitch_requests: pitch_requestsSlice,
playlist_placements: playlist_placementsSlice,
royalty_reports: royalty_reportsSlice,
royalty_lines: royalty_linesSlice,
wallets: walletsSlice,
wallet_transactions: wallet_transactionsSlice,
payout_methods: payout_methodsSlice,
withdrawal_requests: withdrawal_requestsSlice,
tax_documents: tax_documentsSlice,
analytics_daily: analytics_dailySlice,
notifications: notificationsSlice,
notification_preferences: notification_preferencesSlice,
api_keys: api_keysSlice,
dashboard_widgets: dashboard_widgetsSlice,
activity_events: activity_eventsSlice,
blog_posts: blog_postsSlice,
faq_items: faq_itemsSlice,
contact_messages: contact_messagesSlice,
referral_programs: referral_programsSlice,
referral_links: referral_linksSlice,
referral_conversions: referral_conversionsSlice,
  },
})

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