busiInsurance.js 2.0 KB
import * as types from '../constants/ActionTypes'

const initialState = {
  productsList: {},
  productsDetails: {},
  programmesList: {},
  programmesDetails: {},
  setProgrammesList: {},
  insurancesCount: {},
  personInsurancesList: {},
  personDetails: {},
  dealList: {},
  importRecordList: {},
  importRecordDetails: {},
}

export default function attendance(state = initialState, action) {
  switch (action.type) {
    case types.GET_PRODUCTS_LIST:
      return Object.assign({}, state, {
        productsList: action.productsList,
      })
      break
    case types.GET_PRODUCTS_DETAILS:
      return Object.assign({}, state, {
        productsDetails: action.productsDetails,
      })
      break
    case types.GET_PROGRAMMES_LIST:
      return Object.assign({}, state, {
        programmesList: action.programmesList,
      })
      break
    case types.GET_PROGRAMMES_DETAILS:
      return Object.assign({}, state, {
        programmesDetails: action.programmesDetails,
      })
      break
    case types.GET_SET_PROGRAMMES_LIST:
      return Object.assign({}, state, {
        setProgrammesList: action.setProgrammesList,
      })
      break
    case types.GET_INSURANCES_COUNT:
      return Object.assign({}, state, {
        insurancesCount: action.insurancesCount,
      })
      break
    case types.GET_PERSON_INSURANCES_LIST:
      return Object.assign({}, state, {
        personInsurancesList: action.personInsurancesList,
      })
      break
    case types.GET_PERSON_INSURANCES_DETAILS:
      return Object.assign({}, state, {
        personDetails: action.personDetails,
      })
      break
    case types.GET_DEAL_LIST:
      return Object.assign({}, state, {
        dealList: action.dealList,
      })
    case types.GET_IMPORT_RECORD_LIST:
      return Object.assign({}, state, {
        importRecordList: action.importRecordList,
      })
      break
    case types.GET_IMPORT_RECORD_DETAILS:
      return Object.assign({}, state, {
        importRecordDetails: action.importRecordDetails,
      })
      break
    default:
      return state
  }
}