Your project already runs makeReport() on any batch you pick. Since then, you’ve written and checked three rules in exercises: keep unreviewed messages separate, set aside records with missing information, and ignore exact duplicates. Now you’ll run them on a bigger, messier batch and make sure every record ends up somewhere you can point to.
The Brief
Keep working in your starter/feedback-report/ folder from the start of the course. It already includes data/batch-3.js and the Small test batch. If you need a fresh copy, download it here; copy your own report.js somewhere safe before replacing files:
Like real feedback, Batch 3 has messages waiting for review, records with holes, and a few double submissions. Your report has to do four things:
- Count the records that pass every rule, by label.
- Keep the source records behind the numbers, as before.
- List pending records, the ones with a
nulllabel, separately. - List every excluded record with its ID and a reason someone can check.
The finished report must meet one requirement: every record in the batch is counted, pending, or excluded, exactly once.
First sketch and try the combined report in your local file. The next browser exercise, Build the Batch Report, gives you automated checks of the same function. Once those tests pass, transfer your checked makeReport() back to this local file, removing export, then repeat the Small test and Batch 3 checks here. Keep one working local copy so you know which file the page is running.
Your Plan
1. Bring in your checked functions. Paste selectPending(), checkRequired(), and ignoreExactDuplicates() into report.js, along with the supplied messageKey() that your duplicate rule calls.