socialinsurance.js 5.2 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    checkoutAvailable: null,
    customerInsList     : [],
    customerInsListCount: 0,
    payingList          : [],
    payingListCount     : 0,
    supplementList      : [],
    supplementListCount : 0,
    stopList            : [],
    stopListCount       : 0,
    addList             : [],
    addListCount        : 0,
    newSafetyOption     : [],
    otherFees           : [],
    AddElectFileValue   : [],
    AddPaperFileValue   : [],
    AddOtherFileValue   : [],
    addSocial           : {},
    listSocial          : [],
    allListSocial       : {},
    socialArea          : [],
    siSocialArea        : [],
    hfSocialArea        : [],
    socialDetail        : {},
    refundStatic        : {},
    attachments         : [],
    empInsPrompt        : {},
    empSihfMonth        : {}
};

export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.EMP_SIHF_MONTH:
            return Object.assign({}, state, {
                empSihfMonth: action.empSihfMonth,
            });
            break;
        case types.EMP_INS_PROMPT:
            return Object.assign({}, state, {
                empInsPrompt: action.empInsPrompt,
            });
            break;
        case types.CHECKOUT_AVAILABLE:
            return Object.assign({}, state, {
                checkoutAvailable: action.checkoutAvailable,
            });
            break;
        case types.GET_CUTOMER_INS_LIST:
          return Object.assign({}, state, {
              customerInsList: action.customerInsList,
              customerInsListCount: action.customerInsListCount
          });
          break;
        case types.GET_PAYING_LIST:
            return Object.assign({}, state, {
                payingList: action.payingList,
                payingListCount: action.payingListCount
            });
            break;
        case types.GET_SUPPLEMENT_LIST:
            return Object.assign({}, state, {
                supplementList: action.supplementList,
                supplementListCount: action.supplementListCount
            });
            break;
        case types.GET_STOP_LIST:
            return Object.assign({}, state, {
                stopList: action.stopList,
                stopListCount: action.stopListCount
            });
            break;
        case types.GET_ADD_LIST:
            return Object.assign({}, state, {
                addList: action.addList,
                addListCount: action.addListCount
            });
            break;
        case types.SAVE_SOCIAL_TYPE:
            return Object.assign({}, state, {
                newSafetyOption: action.newSafetyOption
            });
            break;
        case types.OTHER_FEES:
            return Object.assign({}, state, {
                otherFees: action.otherFees
            });
            break;
        case types.ELECT_FILE:
            return Object.assign({}, state, {
                AddElectFileValue: action.AddElectFileValue,
                AddPaperFileValue: action.AddPaperFileValue,
                AddOtherFileValue: action.AddOtherFileValue
            });
            break;
        case types.ADD_SOCIAL:
            return Object.assign({}, state, {
                addSocial: action.addSocial
            });
            break;
        case types.LOAD_ALL_SOCIAL_LIST:
            return Object.assign({}, state, {
              allListSocial: action.allListSocial
            });
            break;
        case types.LOAD_SOCIAL_LIST:
            return Object.assign({}, state, {
              listSocial: action.listSocial
            });
            break;
        case types.LOAD_FUND_LIST:
            return Object.assign({}, state, {
                listFund: action.listFund
            });
            break;
        case types.LOAD_SOCIAL_AREA:
            return Object.assign({}, state, {
              socialArea: action.socialArea
            });
            break;
        case types.LOAD_SI_SOCIAL_AREA:
            return Object.assign({}, state, {
                siSocialArea: action.siSocialArea
            });
            break;
        case types.LOAD_HF_SOCIAL_AREA:
            return Object.assign({}, state, {
                hfSocialArea: action.hfSocialArea
            });
            break;
        case types.LOAD_SOCIAL_DETAIL:
            return Object.assign({}, state, {
              socialDetail: action.socialDetail
            });
            break;
        case types.LOAD_REFUND_LIST:
            return Object.assign({}, state, {
                getRefundItem: action.getRefundItem
            });
            break;
        case types.LOAD_REFUND_DETAIL:
            return Object.assign({}, state, {
                getRefundDetailInfo: action.getRefundDetailInfo
            });
            break;
        case types.REFUND_STATIC:
            return Object.assign({}, state, {
                refundStatic: action.refundStatic
            });
            break;
        case types.LOAD_SOCIAL_ATTACHMENTS:
            return Object.assign({},state,{
                attachments        : action.attachments
            });
        default:
            return state;
    }
}