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 languagesSlice from "./languages/languagesSlice";
import gdpr_consentsSlice from "./gdpr_consents/gdpr_consentsSlice";
import gdpr_requestsSlice from "./gdpr_requests/gdpr_requestsSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import hotelsSlice from "./hotels/hotelsSlice";
import room_typesSlice from "./room_types/room_typesSlice";
import roomsSlice from "./rooms/roomsSlice";
import amenitiesSlice from "./amenities/amenitiesSlice";
import room_featuresSlice from "./room_features/room_featuresSlice";
import rate_plansSlice from "./rate_plans/rate_plansSlice";
import seasonal_ratesSlice from "./seasonal_rates/seasonal_ratesSlice";
import inventory_blocksSlice from "./inventory_blocks/inventory_blocksSlice";
import guestsSlice from "./guests/guestsSlice";
import bookingsSlice from "./bookings/bookingsSlice";
import booking_guestsSlice from "./booking_guests/booking_guestsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import invoicesSlice from "./invoices/invoicesSlice";
import messagesSlice from "./messages/messagesSlice";
import promo_codesSlice from "./promo_codes/promo_codesSlice";
import booking_discountsSlice from "./booking_discounts/booking_discountsSlice";
import housekeeping_tasksSlice from "./housekeeping_tasks/housekeeping_tasksSlice";
import service_requestsSlice from "./service_requests/service_requestsSlice";
import content_pagesSlice from "./content_pages/content_pagesSlice";
import settingsSlice from "./settings/settingsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
languages: languagesSlice,
gdpr_consents: gdpr_consentsSlice,
gdpr_requests: gdpr_requestsSlice,
audit_logs: audit_logsSlice,
hotels: hotelsSlice,
room_types: room_typesSlice,
rooms: roomsSlice,
amenities: amenitiesSlice,
room_features: room_featuresSlice,
rate_plans: rate_plansSlice,
seasonal_rates: seasonal_ratesSlice,
inventory_blocks: inventory_blocksSlice,
guests: guestsSlice,
bookings: bookingsSlice,
booking_guests: booking_guestsSlice,
payments: paymentsSlice,
invoices: invoicesSlice,
messages: messagesSlice,
promo_codes: promo_codesSlice,
booking_discounts: booking_discountsSlice,
housekeeping_tasks: housekeeping_tasksSlice,
service_requests: service_requestsSlice,
content_pages: content_pagesSlice,
settings: settingsSlice,
  },
})

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