import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';

import organizationsSlice from "./organizations/organizationsSlice";
import brandsSlice from "./brands/brandsSlice";
import brand_rate_cardsSlice from "./brand_rate_cards/brand_rate_cardsSlice";
import client_ordersSlice from "./client_orders/client_ordersSlice";
import clientsSlice from "./clients/clientsSlice";
import countriesSlice from "./countries/countriesSlice";
import default_activities_productsSlice from "./default_activities_products/default_activities_productsSlice";
import departmentsSlice from "./departments/departmentsSlice";
import marketsSlice from "./markets/marketsSlice";
import outwork_line_itemsSlice from "./outwork_line_items/outwork_line_itemsSlice";
import reportsSlice from "./reports/reportsSlice";
import saved_adaptationsSlice from "./saved_adaptations/saved_adaptationsSlice";
import specs_databaseSlice from "./specs_database/specs_databaseSlice";
import suppliersSlice from "./suppliers/suppliersSlice";
import supporting_documentsSlice from "./supporting_documents/supporting_documentsSlice";
import tracking_categoriesSlice from "./tracking_categories/tracking_categoriesSlice";
import ziflow_workflowsSlice from "./ziflow_workflows/ziflow_workflowsSlice";
import quotesSlice from "./quotes/quotesSlice";
import jobsSlice from "./jobs/jobsSlice";
import adbuilder_assetsSlice from "./adbuilder_assets/adbuilder_assetsSlice";
import client_damSlice from "./client_dam/client_damSlice";
import outworkSlice from "./outwork/outworkSlice";
import adbuilder_templatesSlice from "./adbuilder_templates/adbuilder_templatesSlice";
import campaignsSlice from "./campaigns/campaignsSlice";
import usersSlice from "./users/usersSlice";
import blogsSlice from "./blogs/blogsSlice";
import commentsSlice from "./comments/commentsSlice";
import likesSlice from "./likes/likesSlice";
import postsSlice from "./posts/postsSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";

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

organizations: organizationsSlice,
brands: brandsSlice,
brand_rate_cards: brand_rate_cardsSlice,
client_orders: client_ordersSlice,
clients: clientsSlice,
countries: countriesSlice,
default_activities_products: default_activities_productsSlice,
departments: departmentsSlice,
markets: marketsSlice,
outwork_line_items: outwork_line_itemsSlice,
reports: reportsSlice,
saved_adaptations: saved_adaptationsSlice,
specs_database: specs_databaseSlice,
suppliers: suppliersSlice,
supporting_documents: supporting_documentsSlice,
tracking_categories: tracking_categoriesSlice,
ziflow_workflows: ziflow_workflowsSlice,
quotes: quotesSlice,
jobs: jobsSlice,
adbuilder_assets: adbuilder_assetsSlice,
client_dam: client_damSlice,
outwork: outworkSlice,
adbuilder_templates: adbuilder_templatesSlice,
campaigns: campaignsSlice,
users: usersSlice,
blogs: blogsSlice,
comments: commentsSlice,
likes: likesSlice,
posts: postsSlice,
subscriptions: subscriptionsSlice,
roles: rolesSlice,
permissions: permissionsSlice,
  },
})

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