Activities: show ticket buyer's username + npub in the hoster scan list #117

Open
opened 2026-06-17 17:11:01 +00:00 by padreug · 0 comments
Owner

From the 17 Jun design review: the event hoster's Tickets list (ScanTicketsPage) should show the buyer's username (it currently shows their id/npub), and per follow-up, also show the npub.

Why it's not webapp-only

The hoster roster comes from GET /events/api/v1/tickets/event/{id}/stats, whose per-ticket shape is just:

{ id, name, registered, registered_at }

name is "holder display name from the backend, if any" — in practice the npub/id (per the review). There's no pubkey, npub, or username field, so the webapp can't resolve or display either reliably (treating name as an npub is fragile — it may be a friendly name, an id, an npub, or null).

Proposed fix

  1. aiolabs/events backend: include the buyer's pubkey (and, if available, username) on each ticket in the stats endpoint (and ideally the register endpoint, which already has user_id/email).
  2. Webapp: add pubkey/username to EventTicket (useTicketScanner), and in the scan list row show the username as the primary label with the npub (nip19.npubEncode(pubkey), truncated) beneath — falling back to the current name when absent. Could also resolve a display name via ProfileService from the pubkey.

Deferred from the 17 Jun review batch: backend-dependent, not a clean webapp-only PR.

From the 17 Jun design review: the event hoster's Tickets list (ScanTicketsPage) should show the buyer's **username** (it currently shows their id/npub), and per follow-up, **also show the npub**. ## Why it's not webapp-only The hoster roster comes from `GET /events/api/v1/tickets/event/{id}/stats`, whose per-ticket shape is just: ``` { id, name, registered, registered_at } ``` `name` is "holder display name from the backend, if any" — in practice the npub/id (per the review). There's **no pubkey, npub, or username** field, so the webapp can't resolve or display either reliably (treating `name` as an npub is fragile — it may be a friendly name, an id, an npub, or null). ## Proposed fix 1. **`aiolabs/events` backend:** include the buyer's `pubkey` (and, if available, `username`) on each ticket in the stats endpoint (and ideally the register endpoint, which already has `user_id`/`email`). 2. **Webapp:** add `pubkey`/`username` to `EventTicket` (`useTicketScanner`), and in the scan list row show the username as the primary label with the npub (`nip19.npubEncode(pubkey)`, truncated) beneath — falling back to the current `name` when absent. Could also resolve a display name via ProfileService from the pubkey. _Deferred from the 17 Jun review batch: backend-dependent, not a clean webapp-only PR._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/webapp#117
No description provided.