iVendNextDevelopers Request a sandbox

S24 — Price-checker kiosk (a page on the shop floor, priced by the shop)

What the shop does

A tablet or screen stands on the shop floor. A customer scans an item and reads its name, its picture and its price. The price is the shop's own: the store's price list price for one unit, in the scanned unit, found and converted by the shop itself (the same price list lookup the till starts a sale from). Nobody signs in on the tablet; the shop switches each kiosk on and off in Desk.

On the kiosk When
name, picture, Price and Any offer is worked out at the till. the scan finds an item with a price on the store's list
"We could not find this item. Please ask a member of staff." nothing matches the scan
"This item has no price here. Please ask a member of staff." no price on the store's list (never shown as free)
"This item is not on sale. Please ask a member of staff." the shop refuses to price it (disabled, past its end of life, a template)
"This kiosk is not set up. Please ask a member of staff." the kiosk's record is missing or switched off
"Price checks are not available right now." the shop or the service cannot be reached

Offers are not shown. On iVendNext a selling offer is a promotion, and the engine works promotions out on a whole sale at the till (it refuses a selling price rule), so a one-unit price check cannot ask for one; the kiosk says Any offer is worked out at the till. under every price. It never shows more than the store's list price. The recipe: recipes/price_checker.md.

File What it is
manifest.json the record type PP PRC Kiosk (one record per screen; its name is a random code; it takes its company, price list, currency, walk-in customer and store from the till profile chosen on it), its help address, and a feed registration that names the app's one integration user. Nothing else: no till key, no check, no field on the shop's own records
price.py the pure core: the kiosk's code and scan, the kiosk's date, the Kiosk record, the arguments for the shop's line pricer (no price rule, never a rate), and the answer
service/app.py the service, standard library only: the page (GET /), POST /prc/price, GET /health, and the app template's handshake for many shops; on CitiXsys hosting it runs as a function (lambda_handler)
service/kiosk.html · kiosk.js · kiosk.css the kiosk's page: a scan box that keeps the focus, the answer drawn as text only, cleared after 20 seconds
Dockerfile · app.json the image for your own server, and the settings file for hosting (a function, paid per call)
tests/ the core, the service over the wire (one shop and many, the function entry, the shop's three reads against a stand-in shop) and the manifest; canaries.py breaks each guarded rule and expects its test to fail

What the shop does to set it up

  1. Before install: make the role PP Integration if the shop does not have it. The install makes an app's own roles only when they are named under its prefix (PP PRC …); PP Integration is the kit's shared role, so the shop makes it.
  2. Make the app's integration user (the integration user recipe), give it the role PP Integration, generate its API key, and choose it on the feed registration PP PRC Kiosk feed. The service reads with that key and writes nothing.
  3. Make one PP PRC Kiosk record per screen: where it stands, and the store's till profile. The record's name is the kiosk's code.
  4. On the tablet, open the app's address with #shop= and the shop's site, then &kiosk= and the record's name, in full screen. A barcode scanner connected to the tablet as a keyboard (USB or Bluetooth) scans into the page.

Run it

python3 -m unittest discover -s samples/s24_price_checker/tests -p 'test_*.py'
python3 samples/s24_price_checker/tests/canaries.py
python3 samples/s24_price_checker/service/app.py samples/s24_price_checker/service/.env.local

Settings, one shop (service/.env.local, never committed): IVN_SHOP_URL, IVN_SHOP_KEY (api key:api secret of the integration user), PORT. Many shops (the app template's handshake): IVN_LIBRARY_APP and a store (IVN_SHOPS_TABLE on CitiXsys hosting, else IVN_SHOPS_FILE); each shop hands over its integration user's key when it connects, and each kiosk's call names its shop. The shop makes that user after the install, so its key can only travel on a later connect (Connect again); until it does, the kiosk says it is not set up. The site connects only to the one *.ivendnext.app address in the manifest's allowed_urls (the POS release that carries the hosted handshake, train T10); the sample names https://prc.partner.example, so write your own. PRC_PREFIX names the Kiosk record type (default PP PRC).

Technical notes

What was proven where

Needs this serves

This page in the kit