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 tenantsSlice from "./tenants/tenantsSlice";
import role_assignmentsSlice from "./role_assignments/role_assignmentsSlice";
import organization_membershipsSlice from "./organization_memberships/organization_membershipsSlice";
import propertiesSlice from "./properties/propertiesSlice";
import amenitiesSlice from "./amenities/amenitiesSlice";
import unit_typesSlice from "./unit_types/unit_typesSlice";
import unitsSlice from "./units/unitsSlice";
import unit_availability_blocksSlice from "./unit_availability_blocks/unit_availability_blocksSlice";
import negotiated_ratesSlice from "./negotiated_rates/negotiated_ratesSlice";
import booking_requestsSlice from "./booking_requests/booking_requestsSlice";
import booking_request_travelersSlice from "./booking_request_travelers/booking_request_travelersSlice";
import approval_stepsSlice from "./approval_steps/approval_stepsSlice";
import reservationsSlice from "./reservations/reservationsSlice";
import reservation_guestsSlice from "./reservation_guests/reservation_guestsSlice";
import service_requestsSlice from "./service_requests/service_requestsSlice";
import invoicesSlice from "./invoices/invoicesSlice";
import invoice_line_itemsSlice from "./invoice_line_items/invoice_line_itemsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import documentsSlice from "./documents/documentsSlice";
import audit_logsSlice from "./audit_logs/audit_logsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import activity_commentsSlice from "./activity_comments/activity_commentsSlice";
import checklistsSlice from "./checklists/checklistsSlice";
import checklist_itemsSlice from "./checklist_items/checklist_itemsSlice";
import job_runsSlice from "./job_runs/job_runsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
tenants: tenantsSlice,
role_assignments: role_assignmentsSlice,
organization_memberships: organization_membershipsSlice,
properties: propertiesSlice,
amenities: amenitiesSlice,
unit_types: unit_typesSlice,
units: unitsSlice,
unit_availability_blocks: unit_availability_blocksSlice,
negotiated_rates: negotiated_ratesSlice,
booking_requests: booking_requestsSlice,
booking_request_travelers: booking_request_travelersSlice,
approval_steps: approval_stepsSlice,
reservations: reservationsSlice,
reservation_guests: reservation_guestsSlice,
service_requests: service_requestsSlice,
invoices: invoicesSlice,
invoice_line_items: invoice_line_itemsSlice,
payments: paymentsSlice,
documents: documentsSlice,
audit_logs: audit_logsSlice,
notifications: notificationsSlice,
activity_comments: activity_commentsSlice,
checklists: checklistsSlice,
checklist_items: checklist_itemsSlice,
job_runs: job_runsSlice,
  },
})

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