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

import usersSlice from "./users/usersSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import bedsSlice from "./beds/bedsSlice";
import booking_bedsSlice from "./booking_beds/booking_bedsSlice";
import booking_upsellsSlice from "./booking_upsells/booking_upsellsSlice";
import bookingsSlice from "./bookings/bookingsSlice";
import couponsSlice from "./coupons/couponsSlice";
import event_ordersSlice from "./event_orders/event_ordersSlice";
import event_ticket_typesSlice from "./event_ticket_types/event_ticket_typesSlice";
import event_ticketsSlice from "./event_tickets/event_ticketsSlice";
import eventsSlice from "./events/eventsSlice";
import housekeeping_tasksSlice from "./housekeeping_tasks/housekeeping_tasksSlice";
import inventory_datesSlice from "./inventory_dates/inventory_datesSlice";
import maintenance_ticketsSlice from "./maintenance_tickets/maintenance_ticketsSlice";
import message_threadsSlice from "./message_threads/message_threadsSlice";
import messagesSlice from "./messages/messagesSlice";
import paymentsSlice from "./payments/paymentsSlice";
import reviewsSlice from "./reviews/reviewsSlice";
import room_typesSlice from "./room_types/room_typesSlice";
import roomsSlice from "./rooms/roomsSlice";
import upsellsSlice from "./upsells/upsellsSlice";
import user_rolesSlice from "./user_roles/user_rolesSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import propertiesSlice from "./properties/propertiesSlice";

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

users: usersSlice,
audit_logs: audit_logsSlice,
beds: bedsSlice,
booking_beds: booking_bedsSlice,
booking_upsells: booking_upsellsSlice,
bookings: bookingsSlice,
coupons: couponsSlice,
event_orders: event_ordersSlice,
event_ticket_types: event_ticket_typesSlice,
event_tickets: event_ticketsSlice,
events: eventsSlice,
housekeeping_tasks: housekeeping_tasksSlice,
inventory_dates: inventory_datesSlice,
maintenance_tickets: maintenance_ticketsSlice,
message_threads: message_threadsSlice,
messages: messagesSlice,
payments: paymentsSlice,
reviews: reviewsSlice,
room_types: room_typesSlice,
rooms: roomsSlice,
upsells: upsellsSlice,
user_roles: user_rolesSlice,
roles: rolesSlice,
permissions: permissionsSlice,
properties: propertiesSlice,
  },
})

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