S3 — price-deviation audit: every line sold below list by more than a threshold

A sale with two offers; after the sale, the audit records the one line sold too far below its list price.
For each booked sale, this sample records each line charged below its price-list rate by more than the threshold (a store manager's audit). It runs as your own service, outside the shop. It is for a developer who wants to check every sale after it is booked, and keep the findings where store managers can read them in Desk.
When to use it: you want an after-the-sale check on prices, discounts or anything else a booked sale carries.
What it looks like
| Step | Frame | Screenshot |
|---|---|---|
| 1. A sale with two offers: the case 20% off, the charger 3% off, the cable at list price | the till, 1440 wide | ![]() |
| 2. After the sale, the deviations the service recorded: one line, the case | Desk | ![]() |
| 3. The deviation: list price 1,299.00, charged 1,039.20, 20% below list, threshold 10% | Desk | ![]() |
How it works (outsiders never write Python inside a customer's site)
Outside — outside/: the partner's own service reads sale.booked from the event feed (recipes/event_feed.md), reads the sale over the API with its own narrow key, and writes PP PDO Deviation records — a record type its manifest installs (with a report, a number card, a list setting and the feed registration, switched off until the shop turns it on). A second delivery writes nothing: the record's name is the sale line's id.
Before you build on it. It flags a sale when its event arrives — after the sale, not during it. It has no till key: "Why this price?" needs the remote key (S2's pattern) and is not built here. It has not yet been run against the shop's real event feed, only against a stand-in for it.
Run it
python3 tools/manifest/validate.py samples/s3_price_audit/outside/manifest.json
Technical notes
The walk
The GIF: a cashier sells a leather case at 20% off, a charger at 3% off and a cable at list price; after the sale the partner's service reads the event and records one deviation: the case, 20% below list against a 10% threshold. Frames: the till (/pos?frame=terminal, 1440 wide), then Desk. Walked on our test bench on 2026-10-07, iVendNext POS app at 8dc36aab8. Built from the same screens as the stills below; every frame is cut above the till's key row.
The cashier is the bench's Thabo Nkosi, the customer Johan van der Merwe; the two offers are set up by the sample's bench run for the walk.
Bounds
On our test bench it read the feed through our stand-in for the P-FEED extension point (UNPROVEN against the real one).


