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 app_accountsSlice from './app_accounts/app_accountsSlice';
import applicationsSlice from './applications/applicationsSlice';
import approvalsSlice from './approvals/approvalsSlice';
import audit_logsSlice from './audit_logs/audit_logsSlice';
import benefit_plansSlice from './benefit_plans/benefit_plansSlice';
import billsSlice from './bills/billsSlice';
import candidatesSlice from './candidates/candidatesSlice';
import cardsSlice from './cards/cardsSlice';
import compensationsSlice from './compensations/compensationsSlice';
import deductionsSlice from './deductions/deductionsSlice';
import devicesSlice from './devices/devicesSlice';
import documentsSlice from './documents/documentsSlice';
import earningsSlice from './earnings/earningsSlice';
import employeesSlice from './employees/employeesSlice';
import employmentsSlice from './employments/employmentsSlice';
import enrollment_learningsSlice from './enrollment_learnings/enrollment_learningsSlice';
import enrollmentsSlice from './enrollments/enrollmentsSlice';
import expense_linesSlice from './expense_lines/expense_linesSlice';
import expense_reportsSlice from './expense_reports/expense_reportsSlice';
import goalsSlice from './goals/goalsSlice';
import identity_accountsSlice from './identity_accounts/identity_accountsSlice';
import interviewsSlice from './interviews/interviewsSlice';
import inventory_eventsSlice from './inventory_events/inventory_eventsSlice';
import job_requisitionsSlice from './job_requisitions/job_requisitionsSlice';
import learning_coursesSlice from './learning_courses/learning_coursesSlice';
import leave_requestsSlice from './leave_requests/leave_requestsSlice';
import offersSlice from './offers/offersSlice';
import paymentsSlice from './payments/paymentsSlice';
import payroll_runsSlice from './payroll_runs/payroll_runsSlice';
import policiesSlice from './policies/policiesSlice';
import positionsSlice from './positions/positionsSlice';
import review_cyclesSlice from './review_cycles/review_cyclesSlice';
import reviewsSlice from './reviews/reviewsSlice';
import schedule_shiftsSlice from './schedule_shifts/schedule_shiftsSlice';
import taxesSlice from './taxes/taxesSlice';
import time_entriesSlice from './time_entries/time_entriesSlice';
import timecardsSlice from './timecards/timecardsSlice';
import travel_bookingsSlice from './travel_bookings/travel_bookingsSlice';
import vendorsSlice from './vendors/vendorsSlice';
import rolesSlice from './roles/rolesSlice';
import permissionsSlice from './permissions/permissionsSlice';
import organizationsSlice from './organizations/organizationsSlice';

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

    users: usersSlice,
    app_accounts: app_accountsSlice,
    applications: applicationsSlice,
    approvals: approvalsSlice,
    audit_logs: audit_logsSlice,
    benefit_plans: benefit_plansSlice,
    bills: billsSlice,
    candidates: candidatesSlice,
    cards: cardsSlice,
    compensations: compensationsSlice,
    deductions: deductionsSlice,
    devices: devicesSlice,
    documents: documentsSlice,
    earnings: earningsSlice,
    employees: employeesSlice,
    employments: employmentsSlice,
    enrollment_learnings: enrollment_learningsSlice,
    enrollments: enrollmentsSlice,
    expense_lines: expense_linesSlice,
    expense_reports: expense_reportsSlice,
    goals: goalsSlice,
    identity_accounts: identity_accountsSlice,
    interviews: interviewsSlice,
    inventory_events: inventory_eventsSlice,
    job_requisitions: job_requisitionsSlice,
    learning_courses: learning_coursesSlice,
    leave_requests: leave_requestsSlice,
    offers: offersSlice,
    payments: paymentsSlice,
    payroll_runs: payroll_runsSlice,
    policies: policiesSlice,
    positions: positionsSlice,
    review_cycles: review_cyclesSlice,
    reviews: reviewsSlice,
    schedule_shifts: schedule_shiftsSlice,
    taxes: taxesSlice,
    time_entries: time_entriesSlice,
    timecards: timecardsSlice,
    travel_bookings: travel_bookingsSlice,
    vendors: vendorsSlice,
    roles: rolesSlice,
    permissions: permissionsSlice,
    organizations: organizationsSlice,
  },
});

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