diff --git a/openspec/changes/add-event-tickets/design.md b/openspec/changes/add-event-tickets/design.md index 378cea1..e4de9e6 100644 --- a/openspec/changes/add-event-tickets/design.md +++ b/openspec/changes/add-event-tickets/design.md @@ -51,7 +51,7 @@ Product design: `docs/superpowers/specs/2026-12-04-event-ticketing-design.md` (a - Normalisation and the `MOBILE_OR_EMAIL_REQUIRED`, name-length and email-format errors reuse the QR registration helpers in mobile-api. 4. **Consent creates the lead through `RegistrationService.register`.** It is called with source `TICKET`, no salesperson, the company's current notice and `attend=false`. At check-in it is called with `attend=true`. The returned event lead uuid is stored on the ticket. An attendee whose details match a lead is linked to it, as QR registration already does. - **Unnamed tickets:** the consent needs a name and contact, so on the public page it is offered only for a named ticket. At the door, staff enter them first. -5. **Staff view detection.** The `/t/[code]` page always loads the public view (`GET /api/public/tickets/{code}`). It also calls the portal's `/api/tickets/{code}`, which answers 401 at once when there is no session and otherwise calls `GET /api/admin/tickets/{code}`. That call is guarded by `@AdminModule("BO_EVENTS")` and scoped by company in mobile-api with `loadEvent(uuid, null)`, so another company's event is a 404. On 401, 403 or 404 the page stays public. The admin call uses a plain `fetch`, not `clientApi`, so a signed-out visitor is never bounced to login. +5. **Staff view detection.** The `/t/[code]` page first calls the portal's `/api/tickets/{code}`, which answers 401 at once when there is no session and otherwise calls `GET /api/admin/tickets/{code}`. Only when that fails does it load the public view (`GET /api/public/tickets/{code}`), so a door scan never counts toward the public `tkt:load` limit. That call is guarded by `@AdminModule("BO_EVENTS")` and scoped by company in mobile-api with `loadEvent(uuid, null)`, so another company's event is a 404. On 401, 403 or 404 the page stays public. The admin call uses a plain `fetch`, not `clientApi`, so a signed-out visitor is never bounced to login. 6. **Check-in.** `POST /api/admin/tickets/{code}/checkin` takes optional `{name, mobile, email, consent}`, which are required when the ticket is unnamed. Refusals are 409 with the codes `ALREADY_CHECKED_IN|