Skip to main content
The Scanner router handles QR code scanning, check-ins, event tracking, and station management.

Procedures

getEventLogs

Type: Query
Authentication: Protected (ADMIN role required)
Get paginated event logs with filtering.
limit
number
required
Number of results per page (1-100, default 50)
cursor
string
Cursor for pagination
stationType
enum
Filter by station type (“food” or “events”)
stationId
string
Filter by specific station ID
Search by user name, email, or application name
items
array
Array of event log entries with user and station information
nextCursor
string
Cursor for next page
Example:
const logs = await trpc.scanner.getEventLogs.useQuery({
  limit: 50,
  stationType: "food",
  search: "john"
});

getEventLogStats

Type: Query
Authentication: Protected (ADMIN role required)
Get statistics about event logs.
No input parameters
totalLogs
number
Total number of event logs
foodLogs
number
Number of food station logs
eventLogs
number
Number of event station logs
stationCounts
array
Count of logs per station
Example:
const stats = await trpc.scanner.getEventLogStats.useQuery();
// Returns: { totalLogs: 450, foodLogs: 250, eventLogs: 200, ... }

listStations

Type: Query
Authentication: Protected
Get all stations grouped by type.
No input parameters
[stationType]
array
Object mapping station types to arrays of stations
Example:
const stations = await trpc.scanner.listStations.useQuery();
// Returns: { "food": [...], "events": [...] }

getStationOptions

Type: Query
Authentication: Protected
Get all options for a specific station type.
name
string
required
Station name/type
id
string
Station ID
name
string
Station name
option
string
Station option
Example:
const options = await trpc.scanner.getStationOptions.useQuery({
  name: "food"
});

createStation

Type: Mutation
Authentication: Protected (ADMIN role required)
Create a new station option.
name
string
required
Station name/type (minimum 1 character)
option
string
required
Station option (minimum 1 character)
Example:
await trpc.scanner.createStation.mutate({
  name: "food",
  option: "Dinner"
});

updateStation

Type: Mutation
Authentication: Protected (ADMIN role required)
Update a station option.
id
string
required
Station ID
option
string
required
New option value (minimum 1 character)
Example:
await trpc.scanner.updateStation.mutate({
  id: "station123",
  option: "Lunch"
});

deleteStation

Type: Mutation
Authentication: Protected (ADMIN role required)
Delete a station.
id
string
required
Station ID
Example:
await trpc.scanner.deleteStation.mutate({ id: "station123" });

searchUsers

Type: Query
Authentication: Protected (ADMIN, GENERAL_SCANNER, FOOD_MANAGER, or EVENT_MANAGER role required)
Search for users by name, email, or application name.
query
string
required
Search query (minimum 1 character)
id
string
User ID
name
string
User name
email
string
User email
firstName
string
First name from application
lastName
string
Last name from application
Example:
const users = await trpc.scanner.searchUsers.useQuery({
  query: "john"
});

scan

Type: Mutation
Authentication: Protected (ADMIN, GENERAL_SCANNER, FOOD_MANAGER, or EVENT_MANAGER role required)
Scan a user’s QR code at a station.
id
string
required
User ID from QR code
stationId
string
required
Station ID (or special values: “checkIn”, “judges”, “sleepingBagBorrow”, “sleepingBagReturn”)
id
string
User ID
name
string
User name
email
string
User email
image
string
User profile image
metadata
string
Additional metadata (e.g., T-shirt size for check-in, dietary restrictions for food)
Special Station Behaviors:
  • checkIn: Updates user status to CHECKED_IN, returns T-shirt size
  • judges: Adds JUDGE role to user (ADMIN only)
  • sleepingBagBorrow: Records sleeping bag checkout
  • sleepingBagReturn: Records sleeping bag return
  • food stations: Returns dietary restrictions
  • event stations: Records event attendance
Example:
const result = await trpc.scanner.scan.mutate({
  id: "user123",
  stationId: "checkIn"
});
// Returns: { id: "user123", name: "John Doe", metadata: "T-Shirt Size: L" }

Build docs developers (and LLMs) love