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 product_categoriesSlice from "./product_categories/product_categoriesSlice";
import productsSlice from "./products/productsSlice";
import product_variantsSlice from "./product_variants/product_variantsSlice";
import paint_colorsSlice from "./paint_colors/paint_colorsSlice";
import product_color_setsSlice from "./product_color_sets/product_color_setsSlice";
import brush_typesSlice from "./brush_types/brush_typesSlice";
import product_brush_kitsSlice from "./product_brush_kits/product_brush_kitsSlice";
import reviewsSlice from "./reviews/reviewsSlice";
import cartsSlice from "./carts/cartsSlice";
import cart_itemsSlice from "./cart_items/cart_itemsSlice";
import ordersSlice from "./orders/ordersSlice";
import order_itemsSlice from "./order_items/order_itemsSlice";
import addressesSlice from "./addresses/addressesSlice";
import shipmentsSlice from "./shipments/shipmentsSlice";
import discount_codesSlice from "./discount_codes/discount_codesSlice";
import newsletter_subscriptionsSlice from "./newsletter_subscriptions/newsletter_subscriptionsSlice";
import faq_itemsSlice from "./faq_items/faq_itemsSlice";
import content_pagesSlice from "./content_pages/content_pagesSlice";
import custom_artwork_requestsSlice from "./custom_artwork_requests/custom_artwork_requestsSlice";
import ai_generation_jobsSlice from "./ai_generation_jobs/ai_generation_jobsSlice";
import support_ticketsSlice from "./support_tickets/support_ticketsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
brands: brandsSlice,
product_categories: product_categoriesSlice,
products: productsSlice,
product_variants: product_variantsSlice,
paint_colors: paint_colorsSlice,
product_color_sets: product_color_setsSlice,
brush_types: brush_typesSlice,
product_brush_kits: product_brush_kitsSlice,
reviews: reviewsSlice,
carts: cartsSlice,
cart_items: cart_itemsSlice,
orders: ordersSlice,
order_items: order_itemsSlice,
addresses: addressesSlice,
shipments: shipmentsSlice,
discount_codes: discount_codesSlice,
newsletter_subscriptions: newsletter_subscriptionsSlice,
faq_items: faq_itemsSlice,
content_pages: content_pagesSlice,
custom_artwork_requests: custom_artwork_requestsSlice,
ai_generation_jobs: ai_generation_jobsSlice,
support_tickets: support_ticketsSlice,
  },
})

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