Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
11 KiB
11 KiB
Tasks
Design: design.md (technical contracts) and docs/superpowers/specs/2026-12-01-event-invitations-attendance-design.md (product).
Waves:
- Wave 0 (serial, controller): 1.1 touches SQL and the seed.
- Wave 1 (parallel, at most 3): 2.1 (services-counter, part A) and 3.1 (mobile-api admin). Each is in one module, and they build against the fixed contracts in decisions 3 and 4.
- Wave 2 (parallel, at most 3):
- 2.2 (services-counter, part B, after 2.1);
- 3.2 (mobile-api public, after 3.1);
- 4.1 (gateway).
- Wave 3 (serial): 5.1, 5.2 and 5.3 (portal). They start after the visual revamp foundation (PRODUCT.md, DESIGN.md and tokens) is on
main, and are built in the new look. They share the message catalogue, and 5.1 touches the route guard, which is security code. - Wave 4 (serial, controller): 6.1.
1. Data
- 1.1 SQL
sql/01-event-guests.sql(tableevent_guest, eventcapacity/invitation_cap/checkin_token, event_leadattended_at),sql/02-event-guests-module.sql(moduleBO_EVENT_GUESTS),sql/99-rollback.sql; 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-event-invitations/sql/** - Verify:
SELECTshows the table, its unique keys, the new columns and the module row.
2. services-counter
- 2.1 Shared rules, attendance, event settings and numbers (decisions 2 and 3).
- Depends on: 1.1
- Tests first:
EventDays.isDuring: the first day, the last day, the day before, the day after, a null start, a null end.- Attendance at capture:
- staff capture during the event days sets
attended_at, and before them does not; - QR register sets it the same way;
attend: truesets it on a new or already-captured event lead;- a repeat registration does not set it.
- staff capture during the event days sets
- Event lead update:
attendedtrue sets the time, and false clears it. - Event save:
capacityandinvitationCapare null or at least 1;- a cap below the guest count gives 409
CAP_BELOW_GUESTS.
event/attendance: returns the spec's numbers on a fixture with guests, linked guests, attended event leads and walk-ins.registrationLink/mine: returnsaddedAt.EventGuestentity: maps to the DDL.GuestLinker: links by mobile, then by email; does nothing when the event lead is already linked; staff capture and QR register both call it.
- Scope:
solvway-services-counter/src/** - Verify:
mvn -T 1C -q -pl solvway-services-counter verify
- 2.2 Guests, invite registration and check-in endpoints (decision 3).
- Depends on: 2.1
- Tests first:
- Guest add:
- saves in order up to the cap;
DUPLICATEnames the existing guest, and the unique-key race is treated as a duplicate;CAP_REACHED;NOT_ON_TEAM;- 404 for another company's event.
- Guest remove: 409
GUEST_REGISTEREDwhen the guest is linked. markSent: setsinvited_atonce and increments the count.findByToken: returns the guest or 404.eventGuest/register:- registers with source
INVITEand the guest's salesperson, and links by token; - gives
ALREADY_REGISTEREDon repeat; - gives
EVENT_FULLbefore the event days at capacity; - never gives
EVENT_FULLon the event days.
- registers with source
- Check-in:
checkin/ensureTokencreates the token once;checkin/findEventreturns the event or 404;checkin/lookupgives CHECKED_IN and a first name for a registered guest or any event lead of the event, and setsattended_at;checkin/lookupgives FORM for an invited-not-registered guest and for an unknown person, and returns no details;checkin/byGuestrequires a registered guest and an event day.
- Guest add:
- Scope:
solvway-services-counter/src/** - Verify:
mvn -T 1C -q -pl solvway-services-counter verify
3. mobile-api
- 3.1 Admin guest endpoints, invite email, event fields, attendance, check-in token, event-lead attended (decision 4, admin part).
- Depends on: 1.1 (the contracts in decision 3)
- Tests first:
- Access:
- reads are gated
BO_EVENTS, writesBO_EVENT_GUESTS; - the company scope gives 404 for another company's event.
- reads are gated
- Guest add: validates and normalises like staff capture, with
rejected[].fieldnaming the field.?preview=truesaves nothing. - Send:
- builds one bilingual email per guest with escaped values and
<ADMIN_PORTAL_BASE_URL>/i/<token>, setscompanyIdto the event's company, and callsmarkSentonly for the guests sent; allUnsentskips guests already sent and guests with no email, and returnsskippedNoEmail.
- builds one bilingual email per guest with escaped values and
- Event PUT: ignores
capacityandinvitationCapwithoutBO_EVENT_GUESTS. - Event-lead PUT: passes
attended. - Audit: the target is the event uuid on every guest endpoint.
- Wiring: a test proves the new services start (constructor selection).
- Setting:
ADMIN_PORTAL_BASE_URLdefaults tohttp://localhost:3001in the local profile only, and is logged at startup.
- Access:
- Scope:
solvway-mobile-api/src/** - Verify:
mvn -T 1C -q -pl solvway-mobile-api verify
- 3.2 Public invite and check-in endpoints (decision 4, public part).
- Depends on: 3.1
- Tests first:
- Token checks: a bad token shape gives 404 with no backend call; inactive gives
INVITE_INACTIVEorCODE_INACTIVE. - Invite GET:
- returns the guest's own details only for their own token;
- state is OPEN, REGISTERED, CHECKIN or CHECKED_IN by registration, attendance and event day.
- Invite POST:
- checks consent and the honeypot as
/registrationdoes; EVENT_FULLgives 409;- registration gives 200
{eventName}.
- checks consent and the honeypot as
- Invite check-in: only for a registered guest on an event day.
- Check-in GET:
- NOT_YET and ENDED carry only
startDate; - OPEN carries the event, notice and interests.
- NOT_YET and ENDED carry only
- Check-in lookup:
- detects mobile or email;
- returns
firstNameonly for CHECKED_IN; - the FORM answer carries no details.
- Check-in register: calls counter register with
attend: trueand no salesperson. - No
attendleak:/api/public/registrationand the invite POST never passattend, even when the client sends it. - Limits:
inv:load120,inv:submit60 andchk300 give 429TOO_MANY; the check-in page does not countreg:load.
- Token checks: a bad token shape gives 404 with no backend call; inactive gives
- Scope:
solvway-mobile-api/src/** - Verify:
mvn -T 1C -q -pl solvway-mobile-api verify
4. Gateway
- 4.1 Add the decision-5 pairs to
JWTAuthFilter.PUBLIC_REGISTRATION.- Depends on: none (contracts fixed)
- Tests first:
- each new pair passes without a user token;
- these still get 401:
/counter/event/attendance,/counter/eventGuest/list,/counter/eventGuest/add,/counter/eventGuest/remove,/counter/eventGuest/markSent,/counter/checkin/ensureToken, wrong methods, extra segments and bad token shapes.
- Scope:
solvway-api-gateway/src/** - Verify:
mvn -T 1C -q -pl solvway-api-gateway verify
5. Portal
Every portal verify must report the exit codes of lint, tsc and vitest. Vitest exits 1 on unhandled errors even when every test passes.
- 5.1 Public pages: extract the shared registration form from
/r/[token]; add/i/[token]and/c/[token]and their proxies; make all three paths public inrouteGuardwith one pattern, including the reset-pending exemption.- Depends on: 3.2, the visual revamp foundation
- Tests first:
- Route guard:
/i/xand/c/xpass signed out and with a reset pending;/events,/iand/c/still redirect. - Proxies: forward GET and POST with the last X-Forwarded-For hop only.
- Invite page:
- is filled with the guest's details;
- shows the full state, the inactive state, the check-in button on an event day, and the checked-in state.
- Check-in page:
- shows the not-yet, ended and inactive states with no other details;
- a lookup shows the welcome or a blank form;
- a walk-in submit shows checked in;
- too-many is handled.
/r/: works unchanged.
- Route guard:
- Scope:
solvway-admin-portal/app/**,solvway-admin-portal/middleware*.test.ts - Verify:
cd solvway-admin-portal && npm run lint && npx tsc --noEmit && npx vitest run
- 5.2 Event page: the Guests section, the numbers strip, the capacity and cap fields, the check-in code in the QR card, Print cards (
/events/[uuid]/print), and Copy all links.- Depends on: 3.1, 5.1
- Tests first:
- Guest actions: shown only with
BO_EVENT_GUESTS. - Add and paste:
- add shows field errors;
- paste shows a preview with per-line errors and then saves.
- Send and links:
- send to one and send to all unsent;
- guests with no email offer copy link only;
- "emails are saved until delivery is set up" is stated.
- Remove: only for Invited guests.
- Numbers strip: matches the API.
- Capacity and cap: disabled without the module, with the
CAP_BELOW_GUESTSerror shown. - Print page: one card per member plus the event and check-in codes.
- Copy all:
name: linklines. ROUTE_MODULES: maps the print route.
- Guest actions: shown only with
- Scope:
solvway-admin-portal/app/** - Verify: as 5.1
- 5.3 My QR codes (Share, full screen), the new-code notice in the shell, and the event leads Attended column and filter, Source column and Attended checkbox in the edit form.
- Depends on: 5.2
- Tests first:
- Share: uses
navigator.sharewhen present, otherwise the clipboard. - Full screen: shows only the QR.
- Notice: shown for a code with
addedAtwithin 7 days, and dismissed per code. - Event leads:
- the Attended column and filter;
- the Source column;
- the edit Attended checkbox sends
attended.
- Share: uses
- Scope:
solvway-admin-portal/app/** - Verify: as 5.1
6. Release
- 6.1 Release checks and docs.
- Depends on: 1.1 to 5.3
docs/deployment.md: the SQL order,ADMIN_PORTAL_BASE_URL, granting Event guests, the new gateway paths, and email delivery until SMTP.- Live check on the local stack:
- invite → register → check in by link;
- check in by lookup, as a guest and as a walk-in;
- a guest captured by staff is linked;
- the cap is refused;
- full before the event, not refused on the day;
- numbers agree with the lists;
- an invite email is saved under Emails;
- the audit targets.
- Playwright at 1280 and 360 px: the invite page, the check-in page (all states), the Guests section, the print page, and My QR codes share and full screen.
- Scope:
docs/deployment.md,openspec/changes/add-event-invitations/tasks.md - Verify: the four Maven modules and the portal verify.
Workflow follow-up
- Whole-branch Opus review, PR to
main, merge, then archive on its own branch with its own PR. - The visual revamp (separate change) lands its foundation before wave 3, then restyles the existing screens.