A small, runnable example of data-validation work: match requested product codes to an approved catalogue, calculate exact whole-unit prices, and stop uncertain rows for review.
| Requested item | Result | Reason |
|---|---|---|
| 3 × CB-16, each | $37.50 matched subtotal | One exact code, valid quantity and unit |
| 10 × WIRE-2, roll | Needs review | Catalogue prices this item per metre |
| 2 × UNKNOWN | Needs review | No catalogue match |
| 1 × DUP | Needs review | Two catalogue entries share the code |
The result remains review_required. The $37.50 is the matched-row subtotal, not a complete or approved quotation. No substitutions or guessed prices.
Download the Node.js source, tests, example input, and actual output.
node test.mjsnode match.mjs input.json output.json
Requires Node.js with ES modules. No third-party packages, hosted service, or model API is needed. Tests cover valid pricing, missing and duplicate codes, invalid quantities, mismatched units, unsafe integers, unsupported currency, and incomplete drafts.
This component accepts JSON, USD catalogue prices in integer cents, and positive whole-unit quantities. It does not extract PDFs, create Excel files, infer matches, calculate tax or freight, integrate with an ERP, or send customer quotes. Those need their own scope and tests.
Send an example input, expected output, and the failure you want fixed. Scope, acceptance criteria, timing, and payment arrangements are agreed before work begins.