import { getCreditDataAPI } from "../services/api";
export default {
  namespace: "credit",

  state: {},

  effects: {
    *getCreditData({ payload }, { call, put }) {
      // const response = yield call(getCreditDataAPI, payload);
      // const response = {
      //   content: [{
      //     id: "861864dc-17c7-4db7-a236-497776ff2847",
      //     dr: 0,
      //     ts: 1526019428000,
      //     creator: "douhe",
      //     creationTime: 1526019428000,
      //     modifier: null,
      //     modifiedTime: null,
      //     persistStatus: "nrm",
      //     organizationId: "4667c081-b8b6-41f1-ad1f-01d8160fc229",
      //     organizationCode: "1212",
      //     organizationName: "1212",
      //     saleOrgId: "GP-ORG-01",
      //     saleOrgCode: "GP-ORG-01",
      //     saleOrgName: "北京销售分公司",
      //     customerId: "9f8b5aca-a308-4cb7-84eb-b4d2ddc5b0ef",
      //     customerCode: "cus01",
      //     customerName: "客户01",
      //     productGroupId: "af4e0b29-23de-49b6-ac56-e792197bbdfb",
      //     productGroupCode: "8888",
      //     productGroupName: "产品线01",
      //     creditLimit: 4123,
      //     currencyId: "953d1b60-968d-43ae-827e-cf63d71e23aa",
      //     currencyCode: "USD",
      //     currencyName: "美元",
      //     startDate: 1526313600000,
      //     endDate: 1530288000000,
      //     isEnable: 1,
      //     creditBalance: 3523
      //   },
      //   ]
      // };
      // yield put({
      //   type: "creditData",
      //   creditData: response
      // });
    }
  },
  reducers: {
    creditData(state, payload) {
      return {
        ...state,
        creditData: payload.creditData
      };
    }
  }
};
