import { createSlice } from "@reduxjs/toolkit";
import { auctionExtraReducers } from "./auctionExtraReducers";
import { auctionReducers } from "./auctionReducers";
// import { auctionReducers } from "./auctionReducers";

const initialState = {
  pending: false,
  auctions: [],
  filterByDate: null,
  filterByProvinceAndCity: null,
  auctionSlaughterRequestsData: [],
  provinceFilter: null,
  cityFilter: null,
  quantityFilter: null,
  ageFilter: null,
  raceFilter: null,
  weightFilter: null,
  priceFilter: null,
};

const slice = createSlice({
  name: "auction",
  initialState,
  extraReducers: auctionExtraReducers,
  reducers: auctionReducers,
});

export const { reducer: auctionSlice } = slice;

export const {
  auctionFilterByDate,
  auctionFilterByCity,
  auctionFilterByProvince,
  auctionFilterByQuantity,
  auctionFilterByAge,
  auctionFilterByRace,
  auctionFilterByWeight,
  auctionFilterByPrice,
} = slice.actions;
