import VisitorActionTypes from './visitor.action.types'


export const resetVisitorListState = () => ({
    type: VisitorActionTypes.RESET_STATE
})

export const clearVisitorListState = (data=null) => ({
    type: VisitorActionTypes.VISITOR_LIST_CLEAR_ERROR_STATE,
    payload: data
})

//all operation starters
export const fetchVisitorListStart = (data) =>({
    type: VisitorActionTypes.FETCH_VISITOR_START,
    payload: data
})

export const updateVisitorStart = (body) =>({
    type: VisitorActionTypes.UPDATE_VISITOR_START,
    payload: body
})

export const deactivateVisitorStart = (body) =>({
    type: VisitorActionTypes.DEACTIVATE_VISITOR_START,
    payload: body
})

export const createVisitorStart = (body) =>({
    type: VisitorActionTypes.CREATE_VISITOR_START,
    payload: body
})

//all operation starters end

export const setSelectedVisitor = (data) => ({
    type: VisitorActionTypes.SET_CURRENT_VISITOR,
    payload: data
})

// all operations callbacks
export const updateVisitorSuccess = (data) => ({
    type: VisitorActionTypes.UPDATE_VISITOR_SUCCESS,
    payload: data
})

export const fetchVisitorListSuccess = (data) => ({
    type: VisitorActionTypes.FETCH_VISITOR_SUCCESS,
    payload: data
})

export const visitorListFailure = (errMsg) => ({
    type: VisitorActionTypes.VISITOR_FAILURE,
    payload: errMsg
})
// all operations callbacks end
