import { routerRedux } from 'dva/router';
import * as SpecialReceiveService from '../../services/QC/specialReceive';

export default {

  namespace: 'QCSpecialReceive',
  state: {
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line

    },
  },

  effects: {
    *getOrder ({ payload,onComplete }, { call, put }) {
      const ret = yield call(SpecialReceiveService.getOrder, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
    *SendFlow ({ payload,onComplete }, { call, put }) {
      const ret = yield call(SpecialReceiveService.SendFlow, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
    *FullInStorage ({ payload,onComplete }, { call, put }) {
      const ret = yield call(SpecialReceiveService.FullInStorage, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
