Skip to content

Part 1 of 7 · Age check logger series ~6 min read

An age check logger on AWS for a few dollars a month

The Station Road store failed a test purchase at 21:40 on a Friday. A sixteen-year-old volunteer bought four cans of lager from a member of staff working the till alone, and the till recorded the age prompt being answered clearly over 25. The refusals book for the four weeks before held nine entries. Every one of them had been written before six in the evening.

Bottles of liquor displayed on store shelves
Photo by David Trinks on Unsplash

Key takeaways

  • The till already records every age prompt and the answer chosen. Almost nobody reads it.
  • A refusal count near zero at a busy store is a finding, not a good month.
  • The refusals book stays the record the licence asks for. The system reads it.
  • Ages, policy ages and accepted ID are dated rules, and several are changing.
  • Designed on AWS for about $6 a month.

The whole system on one page

Before any code, here is the shape of what we are designing.

System: till prompts, the refusals book and the rules joined into a registerThree boxes across the top sit outside the AWS account. On the left, Tills: every age prompt and its answer. In the middle, Refusals books: a page photo at each shift end. On the right, The rules: ages, policy, ID and licence conditions. Each connects by an arrow to the AWS account container below, labelled nightly, each shift, and when they change. Inside the AWS account are three components in a row. Prompts and answers: one record per restricted scan. The register: book and till, joined line by line. And Rates and evidence: who refuses, when, and the packs. A note says the till already records the question and the answer, and what nobody does is read the answers as a rate, per person and per shift, beside the book.AWS ACCOUNTTillsevery age prompt,and its answerRefusals booksa page photo ateach shift endThe rulesages, policy, ID,licence conditionsPrompts and answersone record perrestricted scanThe registerbook and till,joined line by lineRates and evidencewho refuses, when,and the packsnightlyeach shiftwhen they changeThe till already records the question and the answer. What nobody does is read the answers as a rate, per person and per shift, beside the book.
Fig 1. Three things outside the account, three pieces inside it. The third box is the one that would have seen Station Road coming.
  • Machine learning
  • Security & identity
  • Analytics
  • Front-end & mobile

Why a well-run shop still fails a test purchase

Because every control it has is a yes-or-no control. The till prompts on every restricted item: yes. There is a Challenge 25 poster at the counter: yes. Everybody has done the training: yes. The refusals book is kept, as the licence requires: yes. None of those four answers changes when one person on one shift stops asking for ID, and that is the only thing a test purchase actually tests.

The information that would have shown it was already in the building. The till knew how often each person had been prompted and what they had answered. The book showed when refusals were being written. Nobody put the two side by side as a rate, because the book gets read for completeness — is it being filled in, is it signed — and a book with nine tidy entries passes that test comfortably.

What runs (the inside)

  • The prompt. Every scan of a restricted item, the rule that applied on that date, and which of three answers was chosen. Part 2.
  • The register. The refusals book, photographed at shift end, transcribed line by line and joined to the till. Part 3.
  • The rate. Refusals and ID checks per thousand prompts, per person, compared with the same kind of shift elsewhere. Part 4.
  • The evidence. What gets assembled when a test purchase fails or a licence comes up for review, and the three months that follow. Part 5.

One group, four stores, four weeks

Four weeks of age prompts across four stores ending in a failed test purchaseA horizontal row of five boxes joined by arrows. Eleven thousand eight hundred and forty-six prompts, each a restricted item on the till. Ten thousand nine hundred and twelve waved on as clearly over the policy age. Seven hundred and sixty-eight ID checks, where ID was seen and the sale went ahead. One hundred and sixty-six refusals, and only nine of them at the busiest store. And one failed test purchase, on a Friday at twenty to ten in the evening with one person on the till. A note says the last box happened at the store with the most prompts and the fewest refusals, and that nine refusals looked like a quiet month.ONE GROUP, FOUR STORES, FOUR WEEKS11,846 promptsa restricted itemon the till10,912 waved onclearly overthe policy age768 ID checksID seen, and thesale went ahead166 refusalsand only 9 at thebusiest store1 failed testFriday, 21:40,one on the tillThe last box happened at the store with the most prompts and the fewest refusals. Nine refusals looked like a quiet month.
Fig 2. Four weeks across the group as one line. The third and fourth boxes are what this system reads, and the fifth is what happened while nobody was reading them.
  • Machine learning
  • Security & identity
  • Management
  • Analytics
  • People

In plain words

Every restricted product in the till’s product file carries a category — alcohol, tobacco, vapes, knives, lottery, aerosol paint — and every category has a rule about age. When one is scanned the till stops and asks the person serving to choose: ID seen, refused, or clearly over the policy age. The tills have done this for years. Their answers are exported every night and almost never read.

Alongside the till sits the refusals book. Most of the licences in the group carry a condition requiring one, and the older ones say a book, so a book it is. At the end of each shift the person closing photographs the current page on the shop phone. The model transcribes each line, and each line is joined to the till’s refused answers from the same store at roughly the same time.

Once a week the system works out, for every login that served, how many prompts were answered, how many became ID checks and how many became refusals, split by the kind of shift. It compares each person with everybody working the same kind of shift across the group and lists the few whose numbers volume alone cannot explain.

When something goes wrong — a failed test purchase, a complaint, a licence review — it builds an evidence pack from records written at the time: the rule in force, the prompt and its answer, the book, the reviews, and who signed them.

Design rules that shaped every decision

  • A refusal rate near zero is a finding to explain, never a good month.
  • ID seen and waved through are different answers, and are stored as different answers.
  • Minimum ages, policy ages and accepted ID are rules with effective dates, never constants.
  • Where the licence asks for a book, the book stays the record. The system keeps a copy.
  • A blank or unreadable field in a handwritten line stays blank.
  • A person is compared with people working the same kind of shift, never with a store average.

What it does not do

It does not make or block a sale. The till prompt and the person serving make that decision, and a system that second-guessed them at the counter would be slower, less accurate, and would teach staff that somebody else is responsible for the answer.

It does not identify customers and it does not look at CCTV. The descriptions in the book are what staff wrote about people who are, often, children, and the system keeps them only as long as the business has decided it needs them. More detail than the book already holds is not something to build.

It does not run the training either. When a pattern points at a person, what leaves this system is a login, four numbers and the shifts they came from, sent to whoever owns training; assigning and chasing it is a different system. And it is written for England and Wales. Licensing law elsewhere in the UK differs, and the rules table would be a different set of rows.

The next four posts walk through each piece: what the till already records, how the book becomes a register, why the rate matters more than the count, and what the evidence has to show afterwards. One diagram per post, a cost breakdown, and an engineering reference at the end.

All posts