Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
7.1 KiB
qr-registration Specification
Purpose
Walk-in visitors scan an event or salesperson QR code and register themselves as a lead, with recorded PDPA consent, abuse limits and staff tools to show, print and switch off codes.
Requirements
Requirement: Registration codes
The system SHALL give every event one registration code and one personal code per member of the event's team. A code SHALL be an unguessable token in a link of the form /r/<token>. Staff with BO_EVENTS SHALL see each code of an event of their company as a QR image, copy its link, download it as an image, and switch it off or on. Every staff user SHALL see their own personal codes for events of their company that have not ended.
Scenario: Event page codes
- GIVEN event
KL Expowithsales1andsales2on its team - WHEN a user with
BO_EVENTSopens the event - THEN the event's code and the personal codes of
sales1andsales2are shown, each with its QR image and link
Scenario: Own codes
- GIVEN
sales1is on the team ofKL Expo, which ends tomorrow, and ofPenang Fair, which ended last week - WHEN
sales1opens My QR codes - THEN only the personal code for
KL Expois listed
Scenario: Switch a code off
- WHEN staff switch off the event code of
KL Expo - THEN scanning that code shows that it is no longer active
- AND the personal codes still work
Requirement: When a code works
A code SHALL work only while it is switched on, its event is enabled, the event's end date in Malaysia time has not passed, and the event's company has a privacy notice. An inactive or unknown code SHALL show "This code is no longer active." and no event details. A personal code whose salesperson is no longer an active member of the event's team SHALL keep working, and its registrations SHALL have no salesperson.
Scenario: Ended event
- GIVEN
Penang Fairended yesterday - WHEN a visitor scans its code
- THEN the page says the code is no longer active and shows no event details
Scenario: Salesperson left the team
- GIVEN
sales2was removed from the team ofKL Expo - WHEN a visitor registers through
sales2's code - THEN the registration succeeds and the event lead has no salesperson
Requirement: Public registration
The registration page SHALL show the event's name, dates and location, and a form for name (required), mobile and email (at least one), company, job title, the company's active interests, and the privacy notice consent (required). Inputs SHALL be normalised and limited as in staff capture. Every accepted submission SHALL show the same thank-you page naming the event, with a button to register another person, whether or not the person was already known.
Scenario: Register
- WHEN a visitor scans the code of
KL Expo, enters nameAisyah, mobile012-345 6701and ticks the consent - THEN the thank-you page names
KL Expo - AND staff see
Aisyahwith mobile+60123456701in the event's leads as NEW and OPEN
Scenario: Missing consent or contact
- WHEN a visitor submits without ticking the consent, or without a mobile and an email
- THEN nothing is saved and the page shows the error under the field
Scenario: Known person gets the same answer
- GIVEN a lead with mobile
+60123456701exists in the company - WHEN a visitor registers with that mobile
- THEN the page shows the same thank-you page as for a new person
Requirement: Registration matching
A registration SHALL match a lead of the event's company by mobile first and then by email, the newest lead winning among several. A matched lead SHALL NOT be edited: it SHALL be linked as EXISTING, with every submitted value that differs from the lead's written into the event lead's notes. Without a match a new lead SHALL be created as NEW.
Scenario: Existing lead not edited
- GIVEN lead
Aisyahwith mobile+60123456701and no email - WHEN a visitor registers as
Aisyah Rahmanwith that mobile and emaila@example.test - THEN lead
Aisyahstill has no email and its name is unchanged - AND the new event lead is EXISTING and its notes list the submitted name and email
Scenario: Mobile beats email
- GIVEN lead
Ahas mobile+60123456701and leadBhas emailb@example.test - WHEN a visitor registers with that mobile and that email
- THEN the registration is linked to lead
A
Requirement: Registration of a person already captured
When the matched lead is already captured at the event, a registration SHALL change nothing, except that an event lead with no salesperson SHALL get the salesperson of a personal code whose salesperson is an active member of the event's team.
Scenario: Already captured, unassigned
- GIVEN
Aisyahis captured atKL Expowith no salesperson - WHEN she registers again through
sales1's personal code andsales1is on the team - THEN her event lead's salesperson becomes
sales1and nothing else changes
Requirement: Registration record
An event lead created by a registration SHALL have status OPEN, source QR, captured by qr, the consent time and the privacy notice version shown, the chosen interests, and the code's salesperson when that salesperson is an active member of the event's team. Event leads captured by staff SHALL have source STAFF. The status history SHALL record the first status by qr.
Scenario: Personal code assigns
- WHEN a visitor registers through
sales1's personal code forKL Expo - THEN the event lead's salesperson is
sales1, its source is QR and it records the consent time and notice version
Requirement: Privacy notice
Each company SHALL have a privacy notice in English and Bahasa Malaysia, kept as versions: saving a change SHALL add a new version and keep the old ones. Only a super admin SHALL edit it, on the Companies page. The registration page SHALL show the company's current notice in both languages. INS and CV SHALL start with the default notice of the design, with the company's name filled in.
Scenario: Edit the notice
- GIVEN CV's notice is version 3
- WHEN a super admin changes CV's English text and saves
- THEN CV's registration pages show the new text
- AND event leads registered before still point to version 3
Scenario: Not a super admin
- WHEN company staff call the privacy notice update endpoint
- THEN it responds 403
Requirement: Registration abuse limits
The system SHALL accept at most 60 registrations per client IP per event in 10 minutes and serve at most 120 registration page loads per client IP in 10 minutes, answering above either limit with "Too many registrations from this device. Try again later." A submission that fills the hidden honeypot field SHALL get the normal thank-you page and save nothing.
Scenario: Too many submissions
- GIVEN 60 registrations for
KL Expofrom one IP in the last 10 minutes - WHEN the 61st arrives from that IP
- THEN nothing is saved and the page shows the too-many message
Scenario: Honeypot
- WHEN a submission fills the hidden field
- THEN the thank-you page shows and no lead or event lead is saved