From d7a11ab71cd5bbd9a6374ec8439cd48544256c73 Mon Sep 17 00:00:00 2001 From: ngqile Date: Tue, 1 Dec 2026 16:03:38 +0800 Subject: [PATCH] docs(openspec): close attendance path, guard attend flag, order portal after revamp Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- openspec/changes/add-event-invitations/design.md | 8 ++++---- openspec/changes/add-event-invitations/tasks.md | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openspec/changes/add-event-invitations/design.md b/openspec/changes/add-event-invitations/design.md index cf9e350..e316dbc 100644 --- a/openspec/changes/add-event-invitations/design.md +++ b/openspec/changes/add-event-invitations/design.md @@ -25,7 +25,7 @@ The services run with `TZ=Asia/Kuala_Lumpur`, so every stored time is Malaysian - Keep the module-based access model: one new module, and no read-only flags. **Non-Goals:** -- A redesign of the existing screens. The new screens use the current components and will be restyled with the rest of the portal by the coming visual revamp. +- A redesign of the existing screens. The visual revamp is a separate change. The portal tasks of this change start after its foundation (PRODUCT.md, DESIGN.md and tokens) lands, so the new screens are built in the new look. - WhatsApp sending, reminders, RSVP declines. - Backfilling attendance for existing event leads. @@ -117,7 +117,7 @@ All bodies are JSON. `companyId` is always a concrete company, set by mobile-api - `POST /api/admin/events/{uuid}/guests/send` with `{guestIds}` or `{allUnsent: true}` returns `{sent, skippedNoEmail}`. - It builds one email per guest: escaped values, English then Bahasa Malaysia, and the link `/i/`. - It sends with `companyId` = the event's company, then calls counter `markSent` for the sent ones. - - `ADMIN_PORTAL_BASE_URL` is a new mobile-api setting. Emails have no browser origin, unlike the QR card. + - `ADMIN_PORTAL_BASE_URL` is a new mobile-api setting. Emails have no browser origin, unlike the QR card. Only the local profile has a default (`http://localhost:3001`); elsewhere it is required. - `GET /api/admin/events/{uuid}/checkin` returns `{token}`, ensured. - `GET /api/admin/events/{uuid}/attendance` returns the numbers. - Event GET and PUT gain `capacity` and `invitationCap`. The PUT only changes them when the caller has `BO_EVENT_GUESTS`; otherwise it ignores them. @@ -136,6 +136,7 @@ All bodies are JSON. `companyId` is always a concrete company, set by mobile-api - `NOT_YET` and `ENDED` carry only `startDate`, not the other details. An unknown token gives 404 `CODE_INACTIVE`. - `POST /api/public/checkin/{token}/lookup` with `{value}` (mobile or email, detected by the presence of `@`) returns `{result, firstName}`. - `POST /api/public/checkin/{token}/register` takes the walk-in form and returns 200 `{eventName}` (counter register with `attend: true`). + - Only the check-in register sets `attend`. The QR `/api/public/registration` and the invite POST never pass it, whatever the client sends. - **Limits** (Redis keys, 10 minutes): - `inv:load:` 120 and `inv:submit::` 60 for invites; - `chk::` 300 for every check-in call. The check-in page does not count `reg:load`. @@ -149,9 +150,8 @@ Add these anchored method and path pairs: - GET `/counter/checkin/findEvent/[A-Za-z0-9_-]{22}` - POST `/counter/checkin/lookup` - POST `/counter/checkin/byGuest` -- POST `/counter/event/attendance` (for the capacity check on the public invite) -`/counter/registration/register` is already open. Everything else stays closed. +`/counter/registration/register` is already open. The public pages load the event, company, notice and interests through the paths the QR change already opened. Everything else stays closed, including `/counter/event/attendance`: the capacity check runs inside `eventGuest/register`. ### 6. Portal diff --git a/openspec/changes/add-event-invitations/tasks.md b/openspec/changes/add-event-invitations/tasks.md index b7d2f18..3e7f8e0 100644 --- a/openspec/changes/add-event-invitations/tasks.md +++ b/openspec/changes/add-event-invitations/tasks.md @@ -9,7 +9,7 @@ Waves: - 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 share the message catalogue, and 5.1 touches the route guard, which is security code. +- **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 @@ -82,6 +82,7 @@ Waves: - **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_URL` defaults to `http://localhost:3001` in the local profile only, and is logged at startup. - 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). @@ -104,6 +105,7 @@ Waves: - returns `firstName` only for CHECKED_IN; - the FORM answer carries no details. - **Check-in register:** calls counter register with `attend: true` and no salesperson. + - **No `attend` leak:** `/api/public/registration` and the invite POST never pass `attend`, even when the client sends it. - **Limits:** `inv:load` 120, `inv:submit` 60 and `chk` 300 give 429 `TOO_MANY`; the check-in page does not count `reg:load`. - Scope: `solvway-mobile-api/src/**` - Verify: `mvn -T 1C -q -pl solvway-mobile-api verify` @@ -114,7 +116,7 @@ Waves: - Depends on: none (contracts fixed) - Tests first: - each new pair passes without a user token; - - these still get 401: `/counter/eventGuest/list`, `/counter/eventGuest/add`, `/counter/eventGuest/remove`, `/counter/eventGuest/markSent`, `/counter/checkin/ensureToken`, wrong methods, extra segments and bad token shapes. + - 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` @@ -123,7 +125,7 @@ Waves: 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 in `routeGuard` with one pattern, including the reset-pending exemption. - - Depends on: 3.2 + - Depends on: 3.2, the visual revamp foundation - Tests first: - **Route guard:** `/i/x` and `/c/x` pass signed out and with a reset pending; `/events`, `/i` and `/c/` still redirect. - **Proxies:** forward GET and POST with the last X-Forwarded-For hop only. @@ -191,4 +193,4 @@ Every portal verify must report the exit codes of lint, tsc and vitest. Vitest e ## 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) restyles these screens with the rest of the portal. +- The visual revamp (separate change) lands its foundation before wave 3, then restyles the existing screens.