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 organizationsSlice from "./organizations/organizationsSlice";
import hotelsSlice from "./hotels/hotelsSlice";
import departmentsSlice from "./departments/departmentsSlice";
import staff_profilesSlice from "./staff_profiles/staff_profilesSlice";
import shiftsSlice from "./shifts/shiftsSlice";
import room_typesSlice from "./room_types/room_typesSlice";
import roomsSlice from "./rooms/roomsSlice";
import guestsSlice from "./guests/guestsSlice";
import guest_documentsSlice from "./guest_documents/guest_documentsSlice";
import rate_plansSlice from "./rate_plans/rate_plansSlice";
import seasonal_ratesSlice from "./seasonal_rates/seasonal_ratesSlice";
import dynamic_pricing_rulesSlice from "./dynamic_pricing_rules/dynamic_pricing_rulesSlice";
import sales_channelsSlice from "./sales_channels/sales_channelsSlice";
import ota_connectionsSlice from "./ota_connections/ota_connectionsSlice";
import reservationsSlice from "./reservations/reservationsSlice";
import reservation_guestsSlice from "./reservation_guests/reservation_guestsSlice";
import stay_foliosSlice from "./stay_folios/stay_foliosSlice";
import folio_itemsSlice from "./folio_items/folio_itemsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import refundsSlice from "./refunds/refundsSlice";
import invoicesSlice from "./invoices/invoicesSlice";
import housekeeping_tasksSlice from "./housekeeping_tasks/housekeeping_tasksSlice";
import maintenance_ticketsSlice from "./maintenance_tickets/maintenance_ticketsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import booking_widgetsSlice from "./booking_widgets/booking_widgetsSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import daily_snapshotsSlice from "./daily_snapshots/daily_snapshotsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
hotels: hotelsSlice,
departments: departmentsSlice,
staff_profiles: staff_profilesSlice,
shifts: shiftsSlice,
room_types: room_typesSlice,
rooms: roomsSlice,
guests: guestsSlice,
guest_documents: guest_documentsSlice,
rate_plans: rate_plansSlice,
seasonal_rates: seasonal_ratesSlice,
dynamic_pricing_rules: dynamic_pricing_rulesSlice,
sales_channels: sales_channelsSlice,
ota_connections: ota_connectionsSlice,
reservations: reservationsSlice,
reservation_guests: reservation_guestsSlice,
stay_folios: stay_foliosSlice,
folio_items: folio_itemsSlice,
payments: paymentsSlice,
refunds: refundsSlice,
invoices: invoicesSlice,
housekeeping_tasks: housekeeping_tasksSlice,
maintenance_tickets: maintenance_ticketsSlice,
notifications: notificationsSlice,
booking_widgets: booking_widgetsSlice,
subscriptions: subscriptionsSlice,
audit_logs: audit_logsSlice,
daily_snapshots: daily_snapshotsSlice,
  },
})

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