UI updates for audit.

This commit is contained in:
Patrick Fic
2024-05-24 15:12:25 -07:00
parent 019faf1411
commit 020eccc762
10 changed files with 202 additions and 83 deletions

View File

@@ -11,7 +11,8 @@ import {
setReportingData,
setScoreCard,
setReportingError,
setAuditResults
setAuditResults,
setAuditError
} from "./reporting.actions";
import ReportingApplicationTypes from "./reporting.types";
@@ -46,11 +47,18 @@ export function* onCalculateAudit() {
yield takeLatest(ReportingApplicationTypes.CALCULATE_AUDIT, handleCalculateAudit);
}
export function* handleCalculateAudit({ payload: claimsArrayFromAudit }) {
if (claimsArrayFromAudit.length === 0) {
yield put(
setAuditError(
"The excel file did not return any matching results for this sheet. Please ensure you have selected the correct sheet. This is typically 'Shop RPS Claim Detail' but may vary."
)
);
return;
}
const rpsJobs = yield select((state) => state.reporting.data);
//Get List of Claims delta.
const missingFromRps = rpsJobs.filter((job) => !claimsArrayFromAudit.find((c) => c.clm_no.includes(job.clm_no)));
const missingFromAudit = claimsArrayFromAudit.filter((c) => !rpsJobs.find((job) => c.clm_no.includes(job.clm_no)));
console.log("Missing From RPS/From Audit", missingFromRps.length, missingFromAudit.length);
//For the items in both spots, highlight the discrepancy.
const claimsArrayHashObject = {};