Flow
The checks a store row has to pass
Loosening the kind check is why the qualifier check has to exist.
1ID shape
Keeps out unfamiliar records. Cost: a new kind of record waits until someone admits it.
2Broad kind
Tolerates different labels for the same shelf. Cost: more look-alikes get through.
3Shared qualifier
Keeps look-alike siblings out. Cost: does nothing when the qualifier isn't on the list.
4Contested row
Avoids guessing between two slots. Cost: some real sales go uncounted.
Flow
Building a test that would catch a leak
The wrong answer is made big enough that a leak can't hide.
1Two slots
Same brand and kind, different pack sizes.
2Two store rows
Same label and size, different qualifier.
3Inflate the wrong one
The look-alike gets much bigger stock and sales than the real product.
4Check the right slot
It should hold only the real product's numbers.
5Check the other slot
The different pack size should get nothing.
The ordering screen told the buyer how much of a slot to order, and the row showed current stock but nothing about what had sold. There was no sales column and no daily rate, so the buyer simply had to trust the recommendation.
Slots on my side, products on theirs
A slot is a position on the plan that any of several interchangeable products can fill. It has a brand, a broad category, a pack size, and usually a short qualifier that separates it from its siblings. The ordering calculations work per slot.
The store's system has never heard of slots. It reports stock and sales per individual product, using its own product names and its own category labels. So before any slot can display sales, something has to decide which store rows belong to which slot, and the new columns are only as reliable as that matching step.
Two systems, two spellings of the same shelf
The matcher used to demand identical category labels. In the test I added, the store and my slot use different vocabulary for the same shelf, so the exact comparison threw the row away and the slot looked like it had sold nothing.
Now identical labels still match, and otherwise both sides get scanned for words that place them in a broad kind of product. They match when they land in the same recognized kind.
That admits more look-alikes, so a second check has to exclude them. The qualifier check is the second condition.
If the slot names a qualifier, the row has to share it. If the slot names none, the row passes this check.
A decoy built to be tempting
The test deliberately sets a trap. Two store rows differ only by the qualifier, and the incorrect one has considerably bigger sales. If it leaked in, the slot's totals would jump. The test verifies that the correct slot receives only the correct row, and that a slot with a different pack size receives nothing.
Two additional rules support this. When two slots could claim the same row, the row is dropped instead of guessed. And the loader now accepts only rows whose identifier looks like the store system's own, instead of skipping a short list of known junk.
What the buyer sees now
The grid has two new columns: units sold over the last month and a daily rate. On slot rows, those figures come from the slot's totals. The product's own figures are only a fallback for rows that never got slot fields. Coverage is calculated against the slot's stock. Invalid inputs display as zero, and the rate keeps two decimals so a slow seller still registers.
A slot with no matched sales displays zero, and that looks exactly like a slot that didn't sell.
When the word list comes up empty
When the slot's qualifier isn't on the recognized list, the set is empty, and the check lets every row through. Separately, one shared qualifier is enough to get in, and I haven't checked whether any slot names two.