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 tenant_membershipsSlice from "./tenant_memberships/tenant_membershipsSlice";
import service_typesSlice from "./service_types/service_typesSlice";
import authentication_methodsSlice from "./authentication_methods/authentication_methodsSlice";
import service_auth_policiesSlice from "./service_auth_policies/service_auth_policiesSlice";
import document_categoriesSlice from "./document_categories/document_categoriesSlice";
import document_typesSlice from "./document_types/document_typesSlice";
import document_template_variablesSlice from "./document_template_variables/document_template_variablesSlice";
import document_templatesSlice from "./document_templates/document_templatesSlice";
import workflow_definitionsSlice from "./workflow_definitions/workflow_definitionsSlice";
import workflow_stepsSlice from "./workflow_steps/workflow_stepsSlice";
import price_listsSlice from "./price_lists/price_listsSlice";
import price_rulesSlice from "./price_rules/price_rulesSlice";
import locationsSlice from "./locations/locationsSlice";
import contract_foldersSlice from "./contract_folders/contract_foldersSlice";
import contract_documentsSlice from "./contract_documents/contract_documentsSlice";
import contract_data_fieldsSlice from "./contract_data_fields/contract_data_fieldsSlice";
import contract_participantsSlice from "./contract_participants/contract_participantsSlice";
import participant_invitationsSlice from "./participant_invitations/participant_invitationsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import payment_sharesSlice from "./payment_shares/payment_sharesSlice";
import authentication_sessionsSlice from "./authentication_sessions/authentication_sessionsSlice";
import authentication_attemptsSlice from "./authentication_attempts/authentication_attemptsSlice";
import id_verification_artifactsSlice from "./id_verification_artifacts/id_verification_artifactsSlice";
import bank_verificationsSlice from "./bank_verifications/bank_verificationsSlice";
import notification_recordsSlice from "./notification_records/notification_recordsSlice";
import notification_record_itemsSlice from "./notification_record_items/notification_record_itemsSlice";
import signing_actionsSlice from "./signing_actions/signing_actionsSlice";
import document_revisionsSlice from "./document_revisions/document_revisionsSlice";
import revision_approvalsSlice from "./revision_approvals/revision_approvalsSlice";
import revocation_requestsSlice from "./revocation_requests/revocation_requestsSlice";
import support_ticketsSlice from "./support_tickets/support_ticketsSlice";
import support_ticket_messagesSlice from "./support_ticket_messages/support_ticket_messagesSlice";
import ai_contract_classificationsSlice from "./ai_contract_classifications/ai_contract_classificationsSlice";
import disallowed_contract_rulesSlice from "./disallowed_contract_rules/disallowed_contract_rulesSlice";
import service_suitability_rulesSlice from "./service_suitability_rules/service_suitability_rulesSlice";
import audit_eventsSlice from "./audit_events/audit_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
tenants: tenantsSlice,
tenant_memberships: tenant_membershipsSlice,
service_types: service_typesSlice,
authentication_methods: authentication_methodsSlice,
service_auth_policies: service_auth_policiesSlice,
document_categories: document_categoriesSlice,
document_types: document_typesSlice,
document_template_variables: document_template_variablesSlice,
document_templates: document_templatesSlice,
workflow_definitions: workflow_definitionsSlice,
workflow_steps: workflow_stepsSlice,
price_lists: price_listsSlice,
price_rules: price_rulesSlice,
locations: locationsSlice,
contract_folders: contract_foldersSlice,
contract_documents: contract_documentsSlice,
contract_data_fields: contract_data_fieldsSlice,
contract_participants: contract_participantsSlice,
participant_invitations: participant_invitationsSlice,
payments: paymentsSlice,
payment_shares: payment_sharesSlice,
authentication_sessions: authentication_sessionsSlice,
authentication_attempts: authentication_attemptsSlice,
id_verification_artifacts: id_verification_artifactsSlice,
bank_verifications: bank_verificationsSlice,
notification_records: notification_recordsSlice,
notification_record_items: notification_record_itemsSlice,
signing_actions: signing_actionsSlice,
document_revisions: document_revisionsSlice,
revision_approvals: revision_approvalsSlice,
revocation_requests: revocation_requestsSlice,
support_tickets: support_ticketsSlice,
support_ticket_messages: support_ticket_messagesSlice,
ai_contract_classifications: ai_contract_classificationsSlice,
disallowed_contract_rules: disallowed_contract_rulesSlice,
service_suitability_rules: service_suitability_rulesSlice,
audit_events: audit_eventsSlice,
  },
})

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