import { vetFarmGetAllocatedService } from "../../../features/vet-farm/services/vet-farm-get-allocated";
import {
  parentCompanyGetBarsOverview,
  vetFarmGetBarsOverview,
} from "../../../features/vet-farm/services/vet-farm-get-bars-overview";
import { vetFarmGetDeletedBarsService } from "../../../features/vet-farm/services/vet-farm-get-deleted-bars";
import { getVetFarms } from "../../../features/vet-farm/services/vet-farm-get-farms";
import { getVetFarmInspectionHistory } from "../../../features/vet-farm/services/vet-farm-get-inspection-history";
import { vetFarmGetOutOfProvinceRequests } from "../../../features/vet-farm/services/vet-farm-get-out-of-province-requests";
import { vatFarmGetProfile } from "../../../features/vet-farm/services/vet-farm-get-profile";

export const vetFarmExtraReducers = {
  [getVetFarms.fulfilled]: (state, { payload }) => {
    state.vetFarms = payload.data;
    state.pending = false;
  },
  [getVetFarms.pending]: (state) => {
    state.pending = true;
  },
  [getVetFarmInspectionHistory.fulfilled]: (state, { payload }) => {
    state.vetFarmInspectionHistory = payload.data;
    state.pending = false;
  },
  [getVetFarmInspectionHistory.pending]: (state) => {
    state.pending = true;
  },
  [vatFarmGetProfile.fulfilled]: (state, { payload }) => {
    state.profile = payload.data;
    state.pending = false;
  },
  [vetFarmGetAllocatedService.fulfilled]: (state, { payload }) => {
    state.vetFarmGetAllocated = payload.data;
    state.pending = false;
  },
  [vetFarmGetDeletedBarsService.fulfilled]: (state, { payload }) => {
    state.vetFarmGetDeletedBars = payload.data;
  },
  [vetFarmGetOutOfProvinceRequests.fulfilled]: (state, { payload }) => {
    state.vetOutOfProvinceRequests = payload.data;
  },
  [vetFarmGetBarsOverview.fulfilled]: (state, { payload }) => {
    state.vetFarmBarsOverview = payload.data;
  },
  [parentCompanyGetBarsOverview.fulfilled]: (state, { payload }) => {
    state.parentCompanyBarsOverview = payload.data;
  },
};
