import * as types from '../constants/ActionTypes';
import createReducer from './reducerFactory';
const initialState = {
    userInfo:{},
    organizations     :[],
    organizationLookup:{},
    orgMes            :{},
    positionMes       :[],
    empMes            :[],
    selectedEmp       :[],
    employee          :[],
    employeeCount     :0,
    loadEmpStatu      :'onboarding',
    loadAttStatu      :'done',
    attendances       :[],
    attendanceCount   :0,
    attendanceOverview:[],
    providentlist     :[],
    socialist         :[],
    addOrgMes         :{},
    turnOutEmp        :'',
    selectData        :[],
    positions         :[],
    workInfo          :{},
    hornorList        :{},
    tenants           :[],
    tenantName        :'',
    subordinates      :[],
    simpleEmployeeData: [],
    currentOrganizations: [],
    getAppNameData:{},
};
export default createReducer(initialState,[
    'CHANGE_USER_INFO', 
    'LOAD_ORGANIZATION',
    'LOAD_CURRENT_ORGANIZATION',
    'LOAD_LOOKUP_ORGANIZATIONS', 
    'CHANGE_ORG_MES', 
    'CHANGE_POSITION_MES', 
    'CHANGE_EMP_MES', 
    'SELECTED_EMP', 
    'LOAD_EMPLOYEE_LIST', 
    'NEED_LOAD_EMPLOYEE_LIST', 
    'LOAD_ATTENDANCE_STATUS', 
    'LOAD_ATTENDANCE', 
    'LOAD_ATTENDANCE_OVERVIEW', 
    'LOAD_PROVIDENT_SOCIAS_LIST', 
    'ADD_ORG_MES', 
    'TURN_OUT_EMP', 
    'SELECT_TURN_OUT_EMP', 
    'LOAD_POSITIONS', 
    'LOAD_REPORTING', 
    'LOAD_REPORTING', 
    'LOAD_TENANTS', 
    'TENANT_NAME', 
    'LOAD_SUBORDINATES' ,
    'GET_SIMPLE_EMPLOYEE',
    'GETAPPNAMEUTIL',
]);
// export default function environment(state = initialState,action) {
//     switch(action.type) {
//     case types.CHANGE_USER_INFO:
//         return Object.assign({}, state, {
//             userInfo: action.userInfo
//         });
//     case types.LOAD_ORGANIZATION:
//         return Object.assign({}, state, {
//             organizations: action.organizations
//         });
//     case types.LOAD_LOOKUP_ORGANIZATIONS:
//         return Object.assign({}, state, {
//             organizationLookup:action.organizationLookup
//         });
//     case types.CHANGE_ORG_MES:
//         return Object.assign({}, state, {
//             orgMes: action.orgMes
//         });
//     case types.CHANGE_POSITION_MES:
//         return Object.assign({}, state, {
//             positionMes: action.positionMes
//         });
//     case types.CHANGE_EMP_MES:
//         return Object.assign({}, state, {
//             empMes: action.empMes
//         });
//     case types.SELECTED_EMP:
//         return Object.assign({}, state, {
//             selectedEmp: action.selectedEmp
//         });
//     case types.LOAD_EMPLOYEE_LIST:
//         return Object.assign({}, state, {
//             employee: action.employee,
//             employeeCount:action.employeeCount,
//             loadEmpStatu:action.loadEmpStatu
//         });
//     case types.NEED_LOAD_EMPLOYEE_LIST:
//         return Object.assign({}, state, {
//             loadEmpStatu: action.loadEmpStatu
//         });
//     case types.LOAD_ATTENDANCE_STATUS:
//         return Object.assign({}, state, {
//             loadAttStatu: action.loadAttStatu
//         });
//     case types.LOAD_ATTENDANCE:
//         return Object.assign({}, state, {
//             attendances: action.attendances,
//             attendanceCount:action.attendanceCount
//         });
//     case types.LOAD_ATTENDANCE_OVERVIEW:
//         return Object.assign({}, state, {
//             attendanceOverview: action.attendanceOverview
//         });
//     case types.LOAD_PROVIDENT_SOCIAS_LIST:
//         return Object.assign({}, state, {
//             providentlist: action.providentlist,
//             socialist:action.socialist
//         });
//     case types.ADD_ORG_MES:
//         return Object.assign({},state,{
//             addOrgMes:action.addOrgMes
//         });
//     case types.TURN_OUT_EMP:
//         return Object.assign({},state,{
//             turnOutEmp:action.turnOutEmp
//         });
//     case types.SELECT_TURN_OUT_EMP:
//         return Object.assign({}, state, {
//             selectData: action.selectData
//         });
//     case types.LOAD_POSITIONS:
//         return Object.assign({}, state, {
//             positions: action.positions
//         });
//     case types.LOAD_REPORTING:
//         return Object.assign({}, state, {
//             workInfo: action.workInfo
//         });
//     case types.LOAD_HORNOR:
//         return Object.assign({}, state, {
//             hornorList: action.hornorList
//         });
//     case types.LOAD_TENANTS:
//         return Object.assign({}, state, {
//             tenants: action.tenants
//         });
//     case types.TENANT_NAME:
//             return Object.assign({}, state, {
//                 tenantName: action.tenantName
//             });
//     case types.LOAD_SUBORDINATES:
//           return Object.assign({}, state, {
//             subordinates: action.subordinates,
//           });
//     default:
//         return state;
//     }
// }