import { createSlice } from "@reduxjs/toolkit";
import { fileExtraReducers } from "./fileExtraReducers";
import { fileReducers } from "./fileReducers";

const initialState = {
  pending: false,
  file: null,
  slaughterHousesRequest: [],
  allocationInformation: null,
  acceptedSlaughterRequest: null,
  selectedRoles: [],
};

const slice = createSlice({
  name: "file",
  initialState,
  extraReducers: fileExtraReducers,
  reducers: fileReducers,
});

export const { reducer: fileSlice } = slice;

export const { cleanFile, CHANGE_SELECTED_ROLES } = slice.actions;
