import ReportingActionTypes from "./reporting.types";

export const queryReportingData = ({ startDate, endDate }) => ({
  type: ReportingActionTypes.QUERY_REPORTING_DATA,
  payload: { startDate, endDate }
});

export const setReportingData = (data) => ({
  type: ReportingActionTypes.SET_REPORTING_DATA,
  payload: data
});

export const calculateScorecard = (data) => ({
  type: ReportingActionTypes.CALCULATE_SCORE_CARD,
  payload: data
});
export const setScoreCard = (data) => ({
  type: ReportingActionTypes.SET_SCORE_CARD,
  payload: data
});
export const setReportingError = (data) => ({
  type: ReportingActionTypes.SET_REPORTING_ERROR,
  payload: data
});
export const toggleGroupVerified = (jobId) => ({
  type: ReportingActionTypes.TOGGLE_GROUP_VERIFIED,
  payload: jobId
});
export const toggleSGIRcc = (jobId) => ({
  type: ReportingActionTypes.TOGGLE_SGI_RCC,
  payload: jobId
});
export const calculateAudit = (claimsArrayFromAudit) => ({
  type: ReportingActionTypes.CALCULATE_AUDIT,
  payload: claimsArrayFromAudit
});
export const setAuditResults = (auditResults) => ({
  type: ReportingActionTypes.SET_AUDIT_RESULTS,
  payload: auditResults
});
export const addExcludedId = (id) => ({
  type: ReportingActionTypes.ADD_EXCLUDED_ID,
  payload: id
});
export const removeExcludedId = (id) => ({
  type: ReportingActionTypes.REMOVE_EXCLUDED_ID,
  payload: id
});
export const clearExcludedIds = () => ({
  type: ReportingActionTypes.CLEAR_EXCLUDED_IDS
});

export const setCachedJobs = (jobs) => ({
  type: ReportingActionTypes.SET_CACHED_JOBS,
  payload: jobs
});

export const setAuditError = (error) => ({ type: ReportingActionTypes.SET_AUDIT_ERROR, payload: error });
