Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
6.1 KiB
6.1 KiB
Tasks
Design: design.md (technical contracts) and docs/superpowers/specs/2026-12-01-qr-self-registration-design.md (product).
Waves:
- Wave 0 (serial, controller): 1.1 and 1.2 touch hotspots (SQL, seed,
package.json). - Wave 1 (parallel, 3 implementers): 2.1, 3.1 and 4.1 build against the fixed contracts in design decisions 2 to 4. Each touches one module only.
- Wave 2 (serial): 5.1, the portal, which also touches the middleware (security).
- Wave 3 (serial, controller): 6.1.
1. Data and dependency
- 1.1 SQL
sql/01,02,99; mirror 01 and 02 inlocal/seed/03-colite.sql; apply 01 and 02 to the local database.- Depends on: none
- Scope:
local/seed/**,openspec/changes/add-qr-self-registration/sql/** - Verify:
SELECTshows the table, the newevent_leadcolumns, and one notice per company with the company name filled in.
- 1.2 Portal: add
qrcode.react(same major as babyboo's portal).- Depends on: none
- Scope:
solvway-admin-portal/package.json,solvway-admin-portal/package-lock.json - Verify:
cd solvway-admin-portal && npm run lint && npx tsc --noEmit && npx vitest run
2. services-counter
- 2.1 Registration links and the registration capture (decision 2).
- Tests first:
ensurecreates the event code and missing personal codes once, keeps order, and makes 22-character unique tokens;setEnabledrefuses another company's or another event's token;findByTokenreturns the link, or 404;minelists only enabled, not-ended events where the user is on the team, creating missing links;register:- new person → NEW, OPEN, QR,
qr, consent fields, interests, history null → OPEN byqr; - known by mobile → EXISTING, lead unchanged, notes list only differing submitted values (null when none);
- mobile beats email when they match different leads;
- newest lead wins among several;
- already captured: unassigned + salesperson → ASSIGNED; otherwise ALREADY_CAPTURED with nothing changed;
- the unique-key race → treated as already captured;
- new person → NEW, OPEN, QR,
- staff capture still sets
source STAFF.
- Scope:
solvway-services-counter/src/** - Verify:
mvn -T 1C -q -pl solvway-services-counter verify
- Tests first:
3. services-system
- 3.1 Company privacy notice versions (decision 3).
- Tests first:
- GET returns the newest version, 404 when none;
- POST adds a version, keeps older ones, trims, requires both texts, at most 5000 characters each, 404 for an unknown company.
- Scope:
solvway-services-system/src/** - Verify:
mvn -T 1C -q -pl solvway-services-system verify
- Tests first:
4. mobile-api
-
4.1 Public registration endpoints and the admin link and notice endpoints (decision 4).
- Tests first:
- GET code checks: inactive for each failing condition (unknown, switched off, event disabled, ended, company inactive, no notice); the active payload includes only active interests;
- POST rejections: honeypot → 200 and no counter call; consent missing → 400
CONSENT_REQUIREDon fieldconsent; - POST validation: same field rules as staff capture; an inactive interest is refused;
- POST salesperson: the code's salesperson is passed when active on the team, null otherwise;
- POST notice: the current notice id comes from the server;
- Limits: 120 page loads per IP and 60 submissions per IP per event per 10 minutes → 429
TOO_MANY(Redis mocked); the IP comes fromHttpReqRespUtils.getClientIpAddressIfServletRequestExist; - Admin: links endpoint scoped by company and gated
BO_EVENTS; toggle; my links for the caller only and[]without a company; privacy notice GET/PUT super-admin only (403 for staff).
- Scope:
solvway-mobile-api/src/** - Verify:
mvn -T 1C -q -pl solvway-mobile-api verify
- Tests first:
-
4.2 Gateway access for the public flow (decision 6), found by the live check.
- Depends on: 4.1
- Tests first:
- gateway: each decision-6 path passes without a user token for its method; POST
/company/1/privacyNotice, GET/user/findById/1, POST/counter/registrationLink/ensureand a path with an extra segment still get 401; - services-system:
activeAdminOfis true only for an enabled type-A user of that company, false otherwise and for an unknown user; - mobile-api: the public salesperson check uses
activeAdminOfand neverfindById.
- gateway: each decision-6 path passes without a user token for its method; POST
- Scope:
solvway-api-gateway/src/**,solvway-services-system/src/**,solvway-mobile-api/src/** - Verify:
mvn -T 1C -q -pl solvway-api-gateway,solvway-services-system,solvway-mobile-api verify
5. Portal
- 5.1 Public page, proxy, middleware, event QR card, My QR codes, Companies privacy notice (decision 5).
- Depends on: 1.2 and the contracts of 4.1
- Tests first:
- middleware:
/r/xand/api/public/registration/xpass signed out, and/eventsstill redirects; - proxy forwards GET and POST with the client IP;
- public page: inactive message, the form with both notice texts, required consent, field errors, too-many, thank-you with "Register another person" resetting the form, honeypot field hidden from people and from assistive technology;
- event QR card: codes, copy, switch (hidden without write access), download;
- My QR codes: list and empty state;
- Companies notice editor: super admin only, save, error;
- the hard-coded copy sweep stays green.
- middleware:
- Scope:
solvway-admin-portal/app/**,solvway-admin-portal/middleware.ts,solvway-admin-portal/middleware*.test.ts - Verify:
cd solvway-admin-portal && npm run lint && npx tsc --noEmit && npx vitest run
6. Release
- 6.1
docs/deployment.md(SQL, notice review, the TraefikX-Forwarded-Fornote, dynamic-qr usage); live check on the local stack; Playwright at 1280 and 360 px:- a visitor registers through an event code and a personal code;
- the inactive, consent and too-many paths;
- staff toggle a code and see My QR codes;
- a super admin edits a notice.
- Depends on: 1.1 to 5.1
- Scope:
docs/deployment.md,openspec/changes/add-qr-self-registration/tasks.md - Verify: the three Maven modules and the portal verify.