import ApplicationActionTypes from "./application.types";

export const setWatchedPaths = (watchedPaths) => ({
  type: ApplicationActionTypes.SET_WATCHED_PATHS,
  payload: watchedPaths
});

export const addWatchedPath = (path) => ({
  type: ApplicationActionTypes.ADD_WATCHED_PATH,
  payload: path
});

export const removeWatchedPath = (path) => ({
  type: ApplicationActionTypes.REMOVE_WATCHED_PATH,
  payload: path
});

export const setWatcherStatus = (status) => ({
  type: ApplicationActionTypes.SET_WATCHER_STATUS,
  payload: status
});

export const setWatcherError = (error) => ({
  type: ApplicationActionTypes.SET_WATCHER_ERROR,
  payload: error
});

export const setSelectedJobId = (jobId) => ({
  type: ApplicationActionTypes.SET_SELECTED_JOB_ID,
  payload: jobId
});
export const setSelectedJobTargetPc = ({ group, v_age, close_date, v_mileage, job }) => ({
  type: ApplicationActionTypes.SET_SELECTED_JOB_TARGET_PC,
  payload: { group, v_age, close_date, v_mileage, job }
});

export const setSelectedJobTargetPcSuccess = (pct) => ({
  type: ApplicationActionTypes.SET_SELECTED_JOB_TARGET_PC_SUCCESS,
  payload: pct
});

export const setSettings = (settingsObj) => ({
  type: ApplicationActionTypes.SET_SETTINGS,
  payload: settingsObj
});

export const setUpdateAvailable = (available) => ({
  type: ApplicationActionTypes.SET_UPDATE_AVAILABLE,
  payload: available
});
export const setUpdateProgress = (progress) => ({
  type: ApplicationActionTypes.SET_UPDATE_PROGRESS,
  payload: progress
});

export const setReleaseNotes = (releaseNotes) => ({
  type: ApplicationActionTypes.SET_RELEASE_NOTES,
  payload: releaseNotes
});
export const setScrubResults = (scrubResults) => ({
  type: ApplicationActionTypes.SET_ES_RESULTS,
  payload: scrubResults
});


export const clearEsResults = () => ({
  type: ApplicationActionTypes.CLEAR_ES_RESULTS
});