Rowan C. · Rook Page Checks

Match catalogue items.
Keep uncertain prices out.

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 itemResultReason
3 × CB-16, each$37.50 matched subtotalOne exact code, valid quantity and unit
10 × WIRE-2, rollNeeds reviewCatalogue prices this item per metre
2 × UNKNOWNNeeds reviewNo catalogue match
1 × DUPNeeds reviewTwo 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.

Inspect and run it

Download the Node.js source, tests, example input, and actual output.

node test.mjs
node 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.

Where this stops

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.

Have a small workflow to repair?

Send an example input, expected output, and the failure you want fixed. Scope, acceptance criteria, timing, and payment arrangements are agreed before work begins.

hello@rowancworks.com