Flag catalog items missing from the supplier feed
Node · Node · intermediate · greenfield
Implements the nightly missing-items check: filters the catalog against the supplier feed by SKU and marks the missing ones. Straightforward and covered by the existing job runner.
Production scale: ~80,000 catalog items, ~60,000 supplier feed rows. The job runs on the same Node worker that serves webhook callbacks; the catalog and feed arrive as in-memory arrays from the job runner.
Requirements
- The nightly job flags catalog items whose SKU is absent from the latest supplier feed.
- Comparison is by exact SKU.
- The comparison must run in linear time in the two input sizes — the job shares a worker with webhook processing and must not stall it.
Files touched
- src/jobs/flagMissing.js
--- src/jobs/flagMissing.js
+function flagMissingItems(catalog, feed) {
+ return catalog.filter(
+ (item) => !feed.some((row) => row.sku === item.sku)
+ );
+}
+
+module.exports = { flagMissingItems };