Skip to main content
The Equipment router handles sleeping bag checkout/return tracking and statistics.

Procedures

getSleepingBagStats

Type: Query
Authentication: Protected (ADMIN role required)
Get statistics about sleeping bag checkouts and returns.
No input parameters
totalCheckouts
number
Total number of sleeping bag checkouts
totalReturns
number
Total number of sleeping bag returns
currentlyCheckedOut
number
Number of sleeping bags currently checked out (checkouts - returns)
Example:
const stats = await trpc.equipment.getSleepingBagStats.useQuery();
// Returns: { totalCheckouts: 45, totalReturns: 30, currentlyCheckedOut: 15 }

getSleepingBagLogs

Type: Query
Authentication: Protected (ADMIN role required)
Get paginated sleeping bag transaction logs.
limit
number
required
Number of results per page (1-100, default 50)
cursor
string
Cursor for pagination (null for first page)
Search by user name, email, or application name
action
enum
Filter by action (CHECK_OUT or RETURN)
items
array
Array of equipment log entries
items[].id
string
Log entry ID
items[].action
enum
CHECK_OUT or RETURN
items[].type
enum
Equipment type (SLEEPING_BAG)
items[].timestamp
datetime
When the action occurred
items[].user
object
User who borrowed/returned the equipment
items[].admin
object
Admin who processed the transaction
nextCursor
string
Cursor for next page (undefined if no more results)
Example:
const logs = await trpc.equipment.getSleepingBagLogs.useQuery({
  limit: 50,
  search: "john",
  action: "CHECK_OUT"
});

getUsersWithUnreturnedBags

Type: Query
Authentication: Protected (ADMIN role required)
Get list of users who currently have unreturned sleeping bags.
No input parameters
user
object
User information
user.id
string
User ID
user.name
string
User name
user.email
string
User email
user.DH12Application
object
Application info with firstName and lastName
admin
object
Admin who processed the last checkout
lastCheckout
datetime
When the sleeping bag was last checked out
Example:
const unreturned = await trpc.equipment.getUsersWithUnreturnedBags.useQuery();
// Returns array sorted by most recent checkout first

Equipment Actions

The following equipment actions are tracked:
  • CHECK_OUT - User borrows equipment
  • RETURN - User returns equipment

Equipment Types

Currently supported equipment types:
  • SLEEPING_BAG - Sleeping bags for overnight hackathon participants

Build docs developers (and LLMs) love