feat(events): show the redeemed promo code in the scanner roster

Maps applied_promo_code from the stats endpoint onto the roster rows as a
small outline badge and includes it in the fuzzy search keys.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByAwHU4pRnyE58YocQvAas
This commit is contained in:
Padreug 2026-09-10 12:22:13 +02:00
commit 7dbe04afa3
2 changed files with 14 additions and 2 deletions

View file

@ -28,6 +28,8 @@ export interface EventTicket {
name?: string | null
registered: boolean
registeredAt: string | null
/** Promo code redeemed on this ticket, when the extension reports it. */
promoCode?: string | null
}
/** Counts + roster snapshot for the event, sourced from the backend. */
@ -110,6 +112,7 @@ export function useTicketScanner(eventId: Ref<string>) {
name: t.name ?? null,
registered: t.registered,
registeredAt: t.registered_at,
promoCode: t.applied_promo_code ?? null,
})),
}
} catch (e) {

View file

@ -104,8 +104,9 @@ const { searchQuery, filteredItems: searchedTickets } = useFuzzySearch(
{
fuseOptions: {
keys: [
{ name: 'name', weight: 0.7 },
{ name: 'id', weight: 0.3 },
{ name: 'name', weight: 0.6 },
{ name: 'id', weight: 0.25 },
{ name: 'promoCode', weight: 0.15 },
],
threshold: 0.3,
ignoreLocation: true,
@ -296,6 +297,14 @@ function fmtTime(iso: string) {
<span v-if="ticket.name" class="font-medium text-foreground">
{{ ticket.name }}
</span>
<Badge
v-if="ticket.promoCode"
variant="outline"
class="text-[10px] font-mono px-1.5"
:title="ticket.promoCode"
>
{{ ticket.promoCode }}
</Badge>
</div>
<p class="font-mono text-[10px] text-muted-foreground break-all mt-0.5">
{{ ticket.id }}