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 world_regionsSlice from "./world_regions/world_regionsSlice";
import locationsSlice from "./locations/locationsSlice";
import player_profilesSlice from "./player_profiles/player_profilesSlice";
import customization_itemsSlice from "./customization_items/customization_itemsSlice";
import toolsSlice from "./tools/toolsSlice";
import item_categoriesSlice from "./item_categories/item_categoriesSlice";
import itemsSlice from "./items/itemsSlice";
import npcsSlice from "./npcs/npcsSlice";
import familiesSlice from "./families/familiesSlice";
import family_membershipsSlice from "./family_memberships/family_membershipsSlice";
import npc_relationshipsSlice from "./npc_relationships/npc_relationshipsSlice";
import dialogue_topicsSlice from "./dialogue_topics/dialogue_topicsSlice";
import dialogue_linesSlice from "./dialogue_lines/dialogue_linesSlice";
import questsSlice from "./quests/questsSlice";
import quest_objectivesSlice from "./quest_objectives/quest_objectivesSlice";
import market_storesSlice from "./market_stores/market_storesSlice";
import employeesSlice from "./employees/employeesSlice";
import suppliersSlice from "./suppliers/suppliersSlice";
import store_productsSlice from "./store_products/store_productsSlice";
import store_inventory_batchesSlice from "./store_inventory_batches/store_inventory_batchesSlice";
import purchase_ordersSlice from "./purchase_orders/purchase_ordersSlice";
import purchase_order_linesSlice from "./purchase_order_lines/purchase_order_linesSlice";
import deliveriesSlice from "./deliveries/deliveriesSlice";
import shelvesSlice from "./shelves/shelvesSlice";
import shelf_slotsSlice from "./shelf_slots/shelf_slotsSlice";
import cash_registersSlice from "./cash_registers/cash_registersSlice";
import sales_transactionsSlice from "./sales_transactions/sales_transactionsSlice";
import sales_transaction_linesSlice from "./sales_transaction_lines/sales_transaction_linesSlice";
import daily_reportsSlice from "./daily_reports/daily_reportsSlice";
import weather_statesSlice from "./weather_states/weather_statesSlice";
import world_calendar_daysSlice from "./world_calendar_days/world_calendar_daysSlice";
import price_modifiersSlice from "./price_modifiers/price_modifiersSlice";
import cropsSlice from "./crops/cropsSlice";
import farm_plotsSlice from "./farm_plots/farm_plotsSlice";
import plantingsSlice from "./plantings/plantingsSlice";
import fish_speciesSlice from "./fish_species/fish_speciesSlice";
import fishing_spotsSlice from "./fishing_spots/fishing_spotsSlice";
import fishing_catchesSlice from "./fishing_catches/fishing_catchesSlice";
import crafting_recipesSlice from "./crafting_recipes/crafting_recipesSlice";
import recipe_ingredientsSlice from "./recipe_ingredients/recipe_ingredientsSlice";
import buildingsSlice from "./buildings/buildingsSlice";
import construction_projectsSlice from "./construction_projects/construction_projectsSlice";
import festivalsSlice from "./festivals/festivalsSlice";
import festival_attendanceSlice from "./festival_attendance/festival_attendanceSlice";
import random_eventsSlice from "./random_events/random_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
world_regions: world_regionsSlice,
locations: locationsSlice,
player_profiles: player_profilesSlice,
customization_items: customization_itemsSlice,
tools: toolsSlice,
item_categories: item_categoriesSlice,
items: itemsSlice,
npcs: npcsSlice,
families: familiesSlice,
family_memberships: family_membershipsSlice,
npc_relationships: npc_relationshipsSlice,
dialogue_topics: dialogue_topicsSlice,
dialogue_lines: dialogue_linesSlice,
quests: questsSlice,
quest_objectives: quest_objectivesSlice,
market_stores: market_storesSlice,
employees: employeesSlice,
suppliers: suppliersSlice,
store_products: store_productsSlice,
store_inventory_batches: store_inventory_batchesSlice,
purchase_orders: purchase_ordersSlice,
purchase_order_lines: purchase_order_linesSlice,
deliveries: deliveriesSlice,
shelves: shelvesSlice,
shelf_slots: shelf_slotsSlice,
cash_registers: cash_registersSlice,
sales_transactions: sales_transactionsSlice,
sales_transaction_lines: sales_transaction_linesSlice,
daily_reports: daily_reportsSlice,
weather_states: weather_statesSlice,
world_calendar_days: world_calendar_daysSlice,
price_modifiers: price_modifiersSlice,
crops: cropsSlice,
farm_plots: farm_plotsSlice,
plantings: plantingsSlice,
fish_species: fish_speciesSlice,
fishing_spots: fishing_spotsSlice,
fishing_catches: fishing_catchesSlice,
crafting_recipes: crafting_recipesSlice,
recipe_ingredients: recipe_ingredientsSlice,
buildings: buildingsSlice,
construction_projects: construction_projectsSlice,
festivals: festivalsSlice,
festival_attendance: festival_attendanceSlice,
random_events: random_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
