// Third-party Imports
import { configureStore } from '@reduxjs/toolkit'

import productReducer from '@/redux-store/slices/product'
import customerReducer from '@/redux-store/slices/customer'
import paymentMethodReducer from '@/redux-store/slices/paymentMethod'
import ingredientReducer from '@/redux-store/slices/ingredient'
import orderReducer from '@/redux-store/slices/order'
import productRecipeReducer from '@/redux-store/slices/productRecipe'
import organizationReducer from '@/redux-store/slices/organization'
import userReducer from '@/redux-store/slices/user'
import vendorReducer from '@/redux-store/slices/vendor'

export const store = configureStore({
  reducer: {
    productReducer,
    customerReducer,
    paymentMethodReducer,
    ingredientReducer,
    orderReducer,
    productRecipeReducer,
    organizationReducer,
    userReducer,
    vendorReducer
  },
  middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false })
})

export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatch
