@go-labs-sg/event-tech 1.15.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -148,6 +148,7 @@ et passport claim --event-id <id> --code <station-code>
148
148
  et passport participant detail --event-id <id> --participant-id <id>
149
149
  et passport prize upsert --event-id <id> --prize-json '{"name":"Tote bag","description":null,"stock":50,"stampCost":5,"order":0}'
150
150
  et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> --quantity 2
151
+ et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> --award-station-id <id> --request-id "$(uuidgen)"
151
152
  et passport station upsert --event-id <id> --station-json '{"name":"Ring toss","collection":{"collectionMode":"STAFF_SCAN","stampValue":3,"category":"GAME"}}'
152
153
  et passport station upsert --event-id <id> --station-json '{"name":"Desk basketball","collection":{"collectionMode":"STAFF_SCAN","category":"GAME","info":{"subtitle":"Game 4 · Desk basketball","steps":["Stand behind the line","Sink 3 shots"]}}}'
153
154
  et passport station upsert --event-id <id> --station-json '{"name":"Food counter","collection":{"collectionMode":"STAFF_TALLY","tallyItems":["Laksa","Teh"],"tallyEarnsStamp":true}}'
@@ -183,7 +184,8 @@ session. A duplicated event does not copy the password. `stamps stats` returns
183
184
  per-station stamp counts, and `stamps recipients` / `recipient-counts` list the
184
185
  participants (name, Staff ID) each station stamped and how (`issuedBy.kind`:
185
186
  `participant` for a self-scan, `station-link`, `staff` with the staff member's name,
186
- or `bingo` for a stamp awarded by completing bingo); recipients page with `--cursor` and
187
+ `bingo` for a stamp awarded by completing bingo, or `prize-desk` for a stamp awarded with a
188
+ prize redemption; `stats` also counts those per station as `prizeDeskStampCount`); recipients page with `--cursor` and
187
189
  `--direction backward`. Station JSON also accepts `address` (up to 300
188
190
  characters, `null` clears it). Signing in with the password is browser-only.
189
191
 
@@ -192,6 +194,12 @@ Station collection modes are `SELF_SCAN`, `STAFF_SCAN`, `STAFF_SCORE` and `STAFF
192
194
  `collection.category` is `GAME`, `FOOD`, `DRINK` or `BINGO` (default `GAME`) and
193
195
  groups stations for guests; the CLI rejects any other value before calling the API.
194
196
  Omit either field on an existing station to keep the stored value.
197
+ `collection.prizeDeskAward` (`true` or `false`, `SELF_SCAN` and `STAFF_SCAN` stations only, not
198
+ the Bingo category) lets prize-desk crew award this station's stamp with a prize redemption (see
199
+ below); omit it to keep the stored value, `false` turns it off, and a station that never set it
200
+ reads as off. Hidden stations may be opted in (a bonus-only card); archived ones never qualify.
201
+ It shows in `overview` and `station upsert` output as `config.prizeDeskAward`, and event
202
+ duplication copies it with the station.
195
203
  `collection.info` is the guest-facing station information shown when a guest taps
196
204
  the station in their passport: `{"subtitle":"Game 4 · Desk basketball","steps":["Stand behind the line","Sink 3 shots"],"menu":[{"name":"Smash burger","detail":"Cooked to order","contains":"Gluten, dairy"}],"note":"Allergen info is indicative. Please ask our crew if unsure."}`.
197
205
  `subtitle` is up to 80 characters, `steps` 1 to 8 lines of up to 160 (shown as "How to
@@ -240,6 +248,55 @@ from `overview` (`passport.simplifiedChinese`) or, before or after sign-in, from
240
248
  (`simplifiedChinese`). Turn it off again by sending `"simplifiedChinese":false`; open signed-in passports
241
249
  switch back to English.
242
250
 
251
+ Identifier label: optional `"staffIdLabel": "<text>"` (up to 40 characters) in `--settings-json`
252
+ names the roster identifier that guests sign in with, station crew look up and organisers see on
253
+ the roster. It defaults to `Employee Number`; send `"staffIdLabel":"Staff ID"` for an event that
254
+ calls it that. Only the wording changes: the `staffId` fields, `loginMethods.staffId` and the
255
+ roster flags keep their names, and the Simplified Chinese passport keeps 员工编号 whatever the
256
+ label. Omit it to keep the stored label; send `"staffIdLabel":null` (or a blank string) to reset
257
+ it to `Employee Number`. Read the current label from `overview` (`passport.staffIdLabel`), from
258
+ `login-options` (`staffIdLabel`), as a guest from `mine` (`settings.staffIdLabel`), or from
259
+ `export` (`staffIdLabel`, for column headers). Changing it is recorded in the activity log.
260
+
261
+ Category names: optional `"categoryLabels"` in `--settings-json` renames the station categories
262
+ (`GAME`, `FOOD`, `DRINK`, `BINGO`) that guests see as group headings and card labels, station crew
263
+ see on their screens and organisers see in the station list, editor and category select. Each
264
+ category takes `{"en": "<text>", "zh-CN": "<text>"}`, either name optional, 1 to 40 characters
265
+ after trimming; a blank name means the built-in wording (for example `Games`). A Simplified Chinese
266
+ guest sees the `zh-CN` name when set and otherwise the built-in Chinese wording, never the English
267
+ name; English guests, crew and organisers use `en`. Omit `categoryLabels` to keep the stored names;
268
+ an object replaces them all (send every name you want to keep); `null` clears them. For example
269
+ `"categoryLabels":{"GAME":{"en":"Games & Activities"}}`. Read the current names from `overview`
270
+ (`passport.categoryLabels`), from `login-options` (`categoryLabels`) or, as a guest, from `mine`
271
+ (`settings.categoryLabels`); each is `null` when none are set. Changing them is recorded in the
272
+ activity log.
273
+
274
+ Queue status: optional `"queueStatus": true|false` in `--settings-json` lets station crew set how
275
+ long the queue is at each station (`< 10 mins`, `< 30 mins` or `> 30 mins`), which guests then see
276
+ on the station in their passport. It is off for an event that never set it. Optional
277
+ `"queueStatusStaleMinutes": <1-240>` is how long a set wait stays trusted before guests see "Not
278
+ updated recently" instead of the age (default 10; `null` resets it). Omit either to keep the stored
279
+ value. While queue status is on, every visible, non-archived station shows a wait: one crew never set
280
+ (or cleared) reads `< 10 mins` by default, so nobody mistakes it for a confirmed wait the default is
281
+ reported in its own field, `queueStatusDefault: "UNDER_10_MIN"` (guests just see `< 10 mins`; crew and
282
+ organisers see it labelled "default"), while `queueStatus` stays `null` for it, and it never goes stale.
283
+ A crew-set wait overrides it (`queueStatus: {status,updatedAt}`, `queueStatusDefault: null`) and goes
284
+ stale as above; hidden stations never show a default. Crew set the wait in the browser; `passport station queue-status --event-id <id> --station-id
285
+ <id> --status under-10|under-30|over-30|clear` does the same as an event operator. It is refused
286
+ while queue status is off, setting the same wait again refreshes its time, `clear` removes the wait
287
+ (the station goes back to the default; the command prints `queueStatus: null` and
288
+ `queueStatusDefault: "UNDER_10_MIN"`),
289
+ and every change is recorded in the activity log with the station and who set it. Turning the
290
+ setting off hides waits from guests without deleting them. Read the switch from `overview`
291
+ (`passport.queueStatus`, `passport.queueStatusStaleMinutes`), each station's wait from `overview`
292
+ (`stations[].queueStatus`: `{status,updatedAt}` for a crew-set wait or `null`, hidden stations
293
+ included, where a stored wait is one guests do not see, and `stations[].queueStatusDefault`: `"UNDER_10_MIN"` while queue status is on and a visible
294
+ station has no crew-set wait, else `null`) and the guest view from `passport queue-status`
295
+ (`enabled`, `staleMinutes`, `generatedAt`, `stations` with the crew-set waits only, and `defaultStatus`
296
+ with `defaultStationIds`, the visible stations that show the default). The CLI has no realtime
297
+ surface: guest screens get waits pushed over the realtime public room, and the CLI reads them on
298
+ demand.
299
+
243
300
  `stamp correct`, `redemption reverse`, station/prize archive and print revocation
244
301
  require `--allow-state-change --target <same-event-id>`; correction/reversal also
245
302
  require a reason. Scored corrections accept `--points` and preserve historical
@@ -253,6 +310,32 @@ stored value. Prizes carry `stampCost` per unit (0 to 100000, default 0; omit on
253
310
  update to keep it). `redemption create` takes `--quantity` (whole number 1 to 20,
254
311
  default 1) and spends `stampCost x quantity` stamps. A participant's balance is
255
312
  stamps earned minus stamps spent; reversing a redemption refunds its stamps.
313
+ `redemption create` also takes an optional `--award-station-id <id>`: the stamp of one station
314
+ that opted in with `collection.prizeDeskAward` (at most one per redemption) is given to the
315
+ participant together with the prize, in the same transaction, as if they had collected it (the
316
+ station's `stampValue` at that moment, an activity-log entry, the lucky draw and bingo/progress
317
+ rules, source `PRIZE_DESK`). The redemption's own checks (threshold, balance, per-person limit,
318
+ stock) use the balance before that stamp. It is refused when the participant already holds that
319
+ station's stamp, when the station is not opted in, archived or outside its opening window, when
320
+ the event takes no stamps (not ongoing), and when a manager revoked their stamp there. A stamp that
321
+ a redemption reversal revoked is back to how it was: it can be awarded again, and the guest can
322
+ also collect that station normally (scan or staff scan). The redemption records which stamp it awarded. `redemption reverse` revokes that stamp with
323
+ the redemption and re-syncs the lucky draw; like revoking a station stamp it is not refused when
324
+ stamps were spent since, so the balance can read negative and prize redemption stays blocked until
325
+ a manager reviews it. `participant detail` returns `awardStations` (the opted-in stations with
326
+ `stamps`, `hidden`, `alreadyCollected` and `blockedReason` for that participant; `blockedReason` also
327
+ says when the station is not open or the event takes no stamps) and
328
+ `redemptions[].awardedStation` (`{id,name,revokedAt}` or `null`; `revokedAt` is the reversal's time
329
+ when the reversal revoked the stamp, an earlier time when a manager had); the redemption response and `mine`
330
+ (`redemptions[].awardedStation`) report it too, the `export` redemption rows add the awarded
331
+ station, and the activity log records `awardedStationId`, `awardedStampId` and `awardedStamps` on
332
+ `passport_prize_redeemed` and `awardedStampRevoked` on `passport_redemption_reversed` (the stamp
333
+ revoke itself is a `passport_stamp_revoked` entry). Optional `--request-id <uuid>` makes a retry
334
+ safe: sending the same id again for the same participant returns the first redemption
335
+ (`replayed: true`) instead of redeeming and awarding twice, and reusing it with a different prize,
336
+ quantity or award station fails. Sending the id of a redemption that was since reversed also fails
337
+ ("This redemption was reversed. Submit it again to hand over a new one.") and writes nothing; use a
338
+ new `--request-id` to redeem again.
256
339
  `mine` also prints the participant's `profileCode` and `profileCodeExpiresAt`; the
257
340
  code is valid for 5 minutes from issue, so run `mine` again for a fresh one.
258
341
  `mine`, `participant detail`, `overview` and `export` return the earned, spent and
@@ -310,7 +393,8 @@ event through the optional `passport` block of the event appearance (hero key
310
393
  visual with a focal point, logo, a graphics-only colour, a dark block colour and
311
394
  `emphasis`). `skin` commands read and write only that block, using the same
312
395
  version-fenced `updateEventAppearance` procedure and `event.setup` permission as
313
- the web editor; every other appearance setting is preserved.
396
+ the web editor; every other appearance setting is preserved. They work for Staff
397
+ Redemption events too (colours and emphasis only, see below).
314
398
 
315
399
  ```sh
316
400
  et passport skin get --event-id <id>
@@ -325,6 +409,7 @@ et passport skin clear --event-id <id> --appearance-version 5
325
409
  - `colors.graphic` paints shapes only, never text. `colors.dark` needs 4.5:1 contrast with white.
326
410
  - `skin clear` returns the event to the Go Labs default look (the reverse of `skin set`). Appearance saves that omit `passport`, including `event appearance update`, keep the stored skin.
327
411
  - Uploads accept JPEG, PNG, WebP or GIF up to 25 MB. SVG is not allowed.
412
+ - The same commands theme a Staff Redemption event: `colors.graphic`, `colors.dark` and `emphasis`, together with the event theme (`et event appearance`), also colour the crew counter and its prize wheel (Settings > Appearance > Counter look in the web app). `heroImage` and `logo` are used only by Event Passport; the Staff Redemption counter ignores them. `skin set` leaves a stored `heroImage` or `logo` as it is unless the patch names it; `skin clear` resets the whole block, including them. To match the Micron Passport look: theme `accentColor` `#06befe`, `backgroundColor` `#e3f7ff`, `textColor` `#0b2d5b` (`et event appearance update`), then `skin set --skin-json '{"colors":{"graphic":"#e8483b","dark":"#0b2d5b"},"emphasis":"ink"}'`.
328
413
 
329
414
  Station cover art uses the station's existing `imageKey`:
330
415
 
@@ -356,6 +441,190 @@ stored photo, pass `null` to clear it. A new key must be an upload to this
356
441
  event's `event-passport/prizes` folder; an unchanged key always passes. `overview`
357
442
  returns `imageKey` and a signed `imageUrl` for each prize.
358
443
 
444
+ ### Staff redemption
445
+
446
+ `et staff-redemption` sets up and runs a staff food redemption with an instant prize draw
447
+ (`STAFF_REDEMPTION` events): crew at a site counter look up an Employee ID, record the food
448
+ items handed over and reveal a prize outcome the server decides in the same transaction.
449
+ Everything uses the same tRPC procedures and permissions as the web app. Setup and the roster
450
+ need `event.setup`, the export needs `event.export`, and the counter commands (`counter`,
451
+ `lookup`, `redeem`) need `event.operate`. Site crew sign in with a site password in the browser
452
+ only; crew sign-in and the counter access check have no CLI command.
453
+
454
+ All commands except `roster import` and `export` are registry commands: pass the procedure input
455
+ with `--input`/`--input-file`, run `et staff-redemption <command> --help` for the schema, and
456
+ confirm every write with `--allow-state-change --target <event-id>`. The commands are:
457
+
458
+ | Area | Commands |
459
+ | --- | --- |
460
+ | Setup | `setup get`, `settings update`, `site upsert`, `crew-password set`, `crew-password clear`, `session upsert`, `slot set`, `item-group upsert`, `item upsert`, `prize upsert`, `prize-stock set`, `rollover preview`, `rollover run`, `rollover list`, `rollover undo`, `archive set` |
461
+ | Roster | `roster list`, `roster counts`, `roster upsert`, `roster import` |
462
+ | Redemption log | `claims list`, `claims counts`, `claims void`, `draw release`, `stock summary`, `export` |
463
+ | Counter | `counter context`, `lookup`, `redeem`, `counter claims` |
464
+
465
+ A walkthrough with made-up names and IDs. Nothing here is an instruction to change a live event;
466
+ `<...>` values come from the previous command's output (`setup get` lists every ID).
467
+
468
+ ```sh
469
+ # 1. The event. The organization must have STAFF_REDEMPTION enabled as an event type
470
+ # (organization create --allowed-event-types, or a global admin enables it).
471
+ et event create --organization-id <org-id> --name "Example Staff Appreciation" \
472
+ --type STAFF_REDEMPTION --location "Example Campus" --start 2026-11-19T07:00:00+08:00
473
+
474
+ # 2. Policies. All four are required before anyone can redeem: eligible shifts, how many
475
+ # items a person may take (ONE_FROM_EACH_GROUP, AT_MOST_ONE_PER_GROUP or
476
+ # AT_MOST_ONE_PER_GROUP_OR_NONE), what happens at the wrong site (REFUSE or
477
+ # SERVE_FROM_COUNTER) and the draw (REMAINING_HEADCOUNT, or FIXED_RATE with
478
+ # fixedWinRatePercent). They lock once the first redemption exists; changing them then
479
+ # needs overrideReason.
480
+ et staff-redemption settings update --allow-state-change --target <event-id> \
481
+ --input '{"eventId":"<event-id>","eligibleShifts":["A","B","C","D"],"itemRule":"ONE_FROM_EACH_GROUP","wrongSite":"REFUSE","drawPolicy":"REMAINING_HEADCOUNT"}'
482
+
483
+ # 3. Sites, and one crew password per site (6-128 characters; this turns the site's crew link
484
+ # on and ends that site's crew sessions). Keep the password out of shell history: put
485
+ # {"eventId":"<event-id>","siteId":"<site-id>","password":"..."} in a file only you can
486
+ # read, pass it with --input-file and delete it afterwards.
487
+ et staff-redemption site upsert --allow-state-change --target <event-id> \
488
+ --input '{"eventId":"<event-id>","name":"North Building"}'
489
+ et staff-redemption crew-password set --allow-state-change --target <event-id> \
490
+ --input-file ./crew-password.json
491
+ et staff-redemption crew-password clear --allow-state-change --target <event-id> \
492
+ --input '{"eventId":"<event-id>","siteId":"<site-id>"}' # turns that site's link off
493
+
494
+ # 4. One session per shift, then the sets each site has for it. A session with
495
+ # redemptions keeps its shift. startsAt and endsAt are optional: an unset
496
+ # time is not enforced, so the session is open whenever the event is.
497
+ et staff-redemption session upsert --allow-state-change --target <event-id> \
498
+ --input '{"eventId":"<event-id>","name":"C shift","shift":"C"}'
499
+ et staff-redemption slot set --allow-state-change --target <event-id> \
500
+ --input '{"eventId":"<event-id>","sessionId":"<session-id>","siteId":"<site-id>","setQuantity":300}'
501
+
502
+ # 5. Items come in groups (a choice of one); crew pick from each group at the counter.
503
+ et staff-redemption item-group upsert --allow-state-change --target <event-id> \
504
+ --input '{"eventId":"<event-id>","name":"Main"}'
505
+ et staff-redemption item upsert --allow-state-change --target <event-id> \
506
+ --input '{"eventId":"<event-id>","groupId":"<group-id>","name":"Chicken wrap"}'
507
+
508
+ # 6. Prizes, and how many of each a slot holds (slotId is in setup get). Stock cannot be set
509
+ # below the prizes already drawn there.
510
+ et staff-redemption prize upsert --allow-state-change --target <event-id> \
511
+ --input '{"eventId":"<event-id>","name":"Insulated bottle"}'
512
+ et staff-redemption prize-stock set --allow-state-change --target <event-id> \
513
+ --input '{"eventId":"<event-id>","slotId":"<slot-id>","prizeId":"<prize-id>","quantity":20}'
514
+
515
+ # 7. The roster, then check it. Columns are matched from the header row (Employee ID,
516
+ # Worker/Name, Site, Shift, Work Shift, Allowance); override with the column flags.
517
+ et staff-redemption roster import --event-id <event-id> --file ./roster.csv \
518
+ --allow-state-change --target <event-id>
519
+ et staff-redemption roster counts --input '{"eventId":"<event-id>"}'
520
+ et staff-redemption setup get --input '{"eventId":"<event-id>"}' # missingPolicies must be []
521
+
522
+ # 8. Day of: look an Employee ID up, then redeem. lookup writes nothing but failed-lookup
523
+ # throttle records. Generate one clientRequestId per redemption; retrying with the same
524
+ # UUID returns the stored receipt and never redeems twice.
525
+ et staff-redemption lookup \
526
+ --input '{"eventId":"<event-id>","siteId":"<site-id>","employeeId":"E1001"}'
527
+ et staff-redemption redeem --allow-state-change --target <event-id> \
528
+ --input "{\"eventId\":\"<event-id>\",\"siteId\":\"<site-id>\",\"employeeId\":\"E1001\",\"clientRequestId\":\"$(uuidgen | tr A-Z a-z)\",\"itemIds\":[\"<item-id>\"]}"
529
+
530
+ # 9. Fix a mistake. void returns the set (the prize outcome stays, so a redo shows the same
531
+ # result); draw release also returns a won prize to stock so the person draws again.
532
+ # draw release is refused while an active redemption still shows the draw (claims list
533
+ # draw.activeClaimCount > 0): void that redemption first.
534
+ et staff-redemption claims list --input '{"eventId":"<event-id>","search":"E1001"}'
535
+ et staff-redemption claims void --allow-state-change --target <event-id> \
536
+ --input '{"eventId":"<event-id>","claimId":"<claim-id>","reason":"Wrong items handed over"}'
537
+ et staff-redemption draw release --allow-state-change --target <event-id> \
538
+ --input '{"eventId":"<event-id>","drawId":"<draw-id>","reason":"Prize not handed over"}'
539
+ # Explicit override, only when the redemption must stay recorded with no prize (a paper
540
+ # entry that never spun): allowWhileClaimActive true. It is written to the activity log.
541
+ et staff-redemption draw release --allow-state-change --target <event-id> \
542
+ --input '{"eventId":"<event-id>","drawId":"<draw-id>","reason":"Paper redemption, no draw","allowWhileClaimActive":true}'
543
+
544
+ # 10. Roll leftovers over (a manager action, never automatic): after C and D on 19 Nov, move
545
+ # what is left at each site into B on 23 Nov. Preview first (it writes nothing), then run
546
+ # it with a reason. sets and prizes both default to true; pass one as false to move only
547
+ # the other. The source keeps exactly what it issued. Only target slots that already exist
548
+ # with sets receive anything (a rollover never creates a slot, so nobody becomes eligible
549
+ # at a site that had no sets); other sites come back with a skipped reason. Nothing to
550
+ # move writes nothing (moved false, rolloverId null). A moved rollover returns its
551
+ # rolloverId. Redo or release voided redemptions first, and roll over only after
552
+ # the source session is over (a site that issued nothing is left at 0 sets).
553
+ et staff-redemption rollover preview \
554
+ --input '{"eventId":"<event-id>","fromSessionId":"<session-c-id>","toSessionId":"<session-b-id>"}'
555
+ et staff-redemption rollover run --allow-state-change --target <event-id> \
556
+ --input '{"eventId":"<event-id>","fromSessionId":"<session-c-id>","toSessionId":"<session-b-id>","sets":true,"prizes":true,"reason":"19 Nov C leftovers into 23 Nov B"}'
557
+
558
+ # 10b. See the rollovers and undo one exactly. list is newest first (limit 1-50, default 20)
559
+ # with undone (null, or who, when and why) and undoable per rollover. undo takes back
560
+ # exactly what that rollover moved: the moved sets and prize quantities leave the
561
+ # target's slots and return to the source's, including a source left at 0 sets; the
562
+ # target's own sets and prizes are not touched. It is all or nothing and needs the
563
+ # moved amounts to be still unissued in the target: otherwise CONFLICT, listing the
564
+ # sites and prizes that are short, and nothing changes (void or release first, or
565
+ # leave it). A second undo is a CONFLICT, another event's rolloverId is NOT_FOUND, and
566
+ # the undo is its own activity entry. A rollover from before undo existed cannot be
567
+ # undone this way (use slot set and prize-stock set).
568
+ et staff-redemption rollover list --input '{"eventId":"<event-id>"}'
569
+ et staff-redemption rollover undo --allow-state-change --target <event-id> \
570
+ --input '{"eventId":"<event-id>","rolloverId":"<rollover-id>","reason":"Rolled over the wrong sessions"}'
571
+
572
+ # 11. Totals and the export.
573
+ et staff-redemption stock summary --input '{"eventId":"<event-id>"}'
574
+ et staff-redemption export --event-id <event-id> --csv-file ./redemptions.csv
575
+ ```
576
+
577
+ **Roster import.** `roster import --file <path.csv|path.xlsx>` adds new Employee IDs and updates
578
+ existing ones by Employee ID; it never deletes, so redemptions survive a re-import. Add
579
+ `--archive-missing` to archive active entries that are not in the file (`archive set` with
580
+ `"entity":"rosterEntry"` and `"archived":false` brings one back, and `roster list` with
581
+ `"archived":"all"` shows the state). Entries that reappear in the file are restored. The result reports
582
+ created, updated, unchanged and archived counts, `rejectedCount` with the first rejected rows
583
+ (blank or repeated Employee ID, too long, bad shift or allowance, or an allowance below the sets
584
+ already collected; the first occurrence of an ID wins) and `unmatchedSites`, the site names in
585
+ the file that match no site. Column flags: `--employee-id-column`, `--name-column`,
586
+ `--site-column`, `--shift-column`, `--work-shift-column`, `--allowance-column`, each taking an
587
+ exact header name (case-insensitive); `none` clears an optional column. Files over 20,000 data
588
+ rows or 200 columns are refused and nothing changes. The roster file is confidential: do not
589
+ commit it. An `.xlsx` is read from its **first sheet** unless `--sheet <name>` names another
590
+ (for example `--sheet "Master list"`; the exact name, else ignoring case and surrounding spaces).
591
+ An unknown name fails and lists the workbook's sheets; nothing changes. A CSV has no sheets, so
592
+ `--sheet` with a CSV fails.
593
+
594
+ **Export.** `export --event-id <id>` prints the redemption rows as JSON, oldest first. Filters:
595
+ `--search`, `--site-id`, `--session-id` and `--status active|voided|all` (default all). With
596
+ `--csv-file <path>` it writes a CSV instead and prints `{ "file", "rows" }`. The CSV has one row
597
+ per claim with the columns Created at, Employee ID, Name, Site, Session, Items, Outcome, Prize,
598
+ Operator kind, Voided at, Void reason and Draw released at. It is UTF-8 with a byte order mark and
599
+ CRLF line ends so Excel opens it correctly; text that would run as a spreadsheet formula (a
600
+ leading `=`, `+`, `-` or `@`) gets a leading apostrophe. An existing file is never overwritten
601
+ unless you pass `--force`. The export needs `event.export` and fails above 20,000 rows; narrow
602
+ it with the filters.
603
+
604
+ **Reading the setup, stock and log.**
605
+
606
+ - `setup get` adds `readiness` to its output: `{ "ready": boolean, "items": [{ "code", "text" }] }`.
607
+ An empty `items` means nothing is missing. Codes: `POLICIES_MISSING`, `NO_SITES`,
608
+ `SITE_WITHOUT_PASSWORD`, `NO_SESSIONS`, `NO_SLOTS`, `SLOT_WITHOUT_SETS`, `NO_ITEM_GROUPS`,
609
+ `GROUP_WITHOUT_ITEMS`, `NO_PRIZES`, `NO_PRIZE_STOCK` (the two prize codes only once a draw policy
610
+ is set), `ROSTER_EMPTY` and `EVENT_NOT_ONGOING`. Archived sites, sessions, groups and prizes are
611
+ ignored. It also adds `truncated` (true when a list was cut at its cap) and `itemsTruncated` on
612
+ each group. Every list in `setup get` and `stock summary` is capped (200 sites, 200 sessions,
613
+ 2,000 slots, 100 item groups, 200 items per group, 200 prizes, 10,000 prize stock rows).
614
+ - `stock summary` adds `truncated` and, to each `slots[]` row, `headcount` (active roster people
615
+ whose roster site and shift are the slot's), `collected` (how many of them have an active claim
616
+ anywhere) and `items` (`[{ "itemId", "handedOut" }]`, only items handed out in that slot; voided
617
+ claims are not counted).
618
+ - `claims list` and `export` rows carry `groupName` on each item and `awayFromRosterSite` (true
619
+ when the person was served at a site other than their roster site; false when their roster
620
+ site matches no site). The CSV export adds "Roster site" and "Away from roster site" columns
621
+ and writes items as `Group: Item`.
622
+ - `counter context` adds `event` (`{ id, name, status, startDateTime, endDateTime }`).
623
+ - `counter claims` takes `scope`: `mine` (default) is the claims made by you at the site (a crew
624
+ device sees its own crew session's), `site` is every claim at the site whoever served it.
625
+ Both need the same counter access, so `event.operate` for the CLI:
626
+ `et staff-redemption counter claims --input '{"eventId":"<event-id>","siteId":"<site-id>","scope":"site"}'`.
627
+
359
628
  ### Deprecated event types
360
629
 
361
630
  Scavenger Hunt (Amazing Race) and Gardens by the Bay are deprecated and frozen.
@@ -305,6 +305,80 @@ Run `et <command> --help` for the full input JSON Schema.
305
305
  - `et human-bingo submissions respond` → `event.humanBingo.admin.respondToBingoCardItemSubmission` (mutation)
306
306
  - Approve or reject a Human Bingo card item submission.
307
307
  - Confirm: `--allow-state-change` `--target <input.id>`
308
+ - `et staff-redemption setup get` → `event.staffRedemption.getStaffRedemptionSetup` (query)
309
+ - Get the whole staff redemption setup: settings, missingPolicies and policiesLocked, sites (with crew access status), sessions, slots with setsIssued, item groups and items, prizes and prize stock. readiness lists what is still missing before counters can serve people (ready, and items of code plus short text); truncated is true when a list was cut at its cap. Archived rows are included with archivedAt; holds no personal data. Needs event.operate.
310
+ - `et staff-redemption settings update` → `event.staffRedemption.updateStaffRedemptionSettings` (mutation)
311
+ - Update eligibleShifts, itemRule, wrongSite, drawPolicy and fixedWinRatePercent; omitted fields are unchanged. Policies lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log.
312
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
313
+ - `et staff-redemption site upsert` → `event.staffRedemption.upsertStaffRedemptionSite` (mutation)
314
+ - Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.
315
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
316
+ - `et staff-redemption crew-password set` → `event.staffRedemption.setStaffRedemptionCrewPassword` (mutation)
317
+ - Set a site's shared crew password (6-128 characters), which turns the site's crew link on. Ends every crew session at that site. Prefer --input-file over --input so the password stays out of shell history.
318
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
319
+ - `et staff-redemption crew-password clear` → `event.staffRedemption.clearStaffRedemptionCrewPassword` (mutation)
320
+ - Clear a site's crew password, which turns its crew link off and ends every crew session at that site.
321
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
322
+ - `et staff-redemption session upsert` → `event.staffRedemption.upsertStaffRedemptionSession` (mutation)
323
+ - Create a session (omit sessionId) or update one: name, shift letter, and optional startsAt and endsAt (ISO date-times; null or omitted means the session is open whenever the event is). Each shift has one session; a session with redemptions keeps its shift.
324
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
325
+ - Date fields: `startsAt`, `endsAt`
326
+ - `et staff-redemption slot set` → `event.staffRedemption.setStaffRedemptionSlot` (mutation)
327
+ - Set how many sets a site has for a session (setQuantity). It cannot go below the sets already issued.
328
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
329
+ - `et staff-redemption item-group upsert` → `event.staffRedemption.upsertStaffRedemptionItemGroup` (mutation)
330
+ - Create an item group (omit groupId; a choice such as wrap or pancake) or rename and reorder one.
331
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
332
+ - `et staff-redemption item upsert` → `event.staffRedemption.upsertStaffRedemptionItem` (mutation)
333
+ - Create an item in a group (omit itemId) or rename, reorder or move one to another groupId; past claims keep their group.
334
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
335
+ - `et staff-redemption prize upsert` → `event.staffRedemption.upsertStaffRedemptionPrize` (mutation)
336
+ - Create a prize (omit prizeId) or rename and reorder one. Stock is set per slot with staff-redemption prize-stock set.
337
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
338
+ - `et staff-redemption prize-stock set` → `event.staffRedemption.setStaffRedemptionPrizeStock` (mutation)
339
+ - Set a prize's stock for one slot (slotId from setup get). An optional reason is recorded; stock cannot go below the prizes already drawn there and not released.
340
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
341
+ - `et staff-redemption rollover preview` → `event.staffRedemption.getStaffRedemptionRolloverPreview` (query)
342
+ - Preview rolling leftovers from fromSessionId into toSessionId, per site: sets left (set quantity minus active, not voided, redemptions) and prizes left (stock minus prizes drawn and not released) in the source, what would move and the target afterwards. A site is skipped, with a reason, unless the target session already has a slot there with sets (a rollover never creates a slot). Advisory; rollover run recomputes under lock. Needs event.setup.
343
+ - `et staff-redemption rollover run` → `event.staffRedemption.rolloverStaffRedemptionStock` (mutation)
344
+ - Move the leftover sets (sets) and/or prizes (prizes), both default true, of every site from fromSessionId into toSessionId, with a required reason (1-300 characters) that is logged. The source keeps exactly what it issued, so it never drops below issued. Skipped sites come back with a reason; moved is false and nothing is written (no quantity, log entry or lock) when nothing would move. Undo it exactly with rollover undo (the result's rolloverId is the id); running it the other way is not an undo. Returns rolloverId, null when nothing moved. Not automatic: a manager runs it. Needs event.setup.
345
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
346
+ - `et staff-redemption rollover list` → `event.staffRedemption.getStaffRedemptionRollovers` (query)
347
+ - List the event's rollovers, newest first (limit 1-50, default 20): id (use it for rollover undo), who ran it and when, reason, from and to sessions, totals, the sets and prizes moved per site, undoable, and undone (null, or who, when and why). total counts all of them. Needs event.setup.
348
+ - `et staff-redemption rollover undo` → `event.staffRedemption.undoStaffRedemptionRollover` (mutation)
349
+ - Undo one rollover exactly (rolloverId from rollover list), with a required reason (1-300 characters) that is logged: subtract exactly the sets and prizes it moved from the target session's slots and add them back to the source's, including a source left at 0 sets. The target's own sets and prizes are untouched. All or nothing: refused with CONFLICT, listing the sites and prizes, when a target site has since handed out or drawn part of what moved (it must still have the moved amount unissued), and with CONFLICT when already undone. A rolloverId of another event is NOT_FOUND. Does not check archived state: it restores exactly even if a session, site or prize was archived since. Redo or release voided target redemptions first, as an unreleased void's set counts as free. Recorded as its own activity entry. Needs event.setup.
350
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
351
+ - `et staff-redemption archive set` → `event.staffRedemption.setStaffRedemptionArchived` (mutation)
352
+ - Archive (archived true) or unarchive (archived false) a site, session, itemGroup, item, prize or rosterEntry by entity and id. Setup get and roster list show the current state.
353
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
354
+ - `et staff-redemption roster list` → `event.staffRedemption.getStaffRedemptionRoster` (query)
355
+ - List roster entries (cursor paged); filter by search, siteId, shift, archived (active, archived, all) and collected (any, collected, not-collected).
356
+ - `et staff-redemption roster counts` → `event.staffRedemption.getStaffRedemptionRosterCounts` (query)
357
+ - Count roster entries matching the same filters as roster list.
358
+ - `et staff-redemption roster upsert` → `event.staffRedemption.upsertStaffRedemptionRosterEntry` (mutation)
359
+ - Add or update one roster entry by employeeId (name, siteName, shift and workShift are required and can be null; allowance is optional). The site is matched by name, and allowance cannot go below the sets the person already collected. The archived state is unchanged (use staff-redemption archive set).
360
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
361
+ - `et staff-redemption claims list` → `event.staffRedemption.getStaffRedemptionClaims` (query)
362
+ - List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome, site, awayFromRosterSite (served at a site other than the roster site), session and void state; filter by search, siteId, sessionId and status (active, voided, all).
363
+ - `et staff-redemption claims counts` → `event.staffRedemption.getStaffRedemptionClaimCounts` (query)
364
+ - Count claims matching the same filters as claims list.
365
+ - `et staff-redemption claims void` → `event.staffRedemption.voidStaffRedemptionClaim` (mutation)
366
+ - Void a claim with a reason. The set returns to the person and the slot; the prize draw is kept, so a redo shows the same outcome until staff-redemption draw release. Claims list shows each draw's activeClaimCount.
367
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
368
+ - `et staff-redemption draw release` → `event.staffRedemption.releaseStaffRedemptionDraw` (mutation)
369
+ - Release a person's prize draw (draw.id from claims list) with a reason: a won prize returns to its slot's stock and the person draws again on their next redemption. Refused (CONFLICT) while an active, not voided redemption still shows the draw (claims list draw.activeClaimCount > 0); void it first, or pass the explicit override allowWhileClaimActive: true to release a prize while its redemption stays recorded (for example a paper entry). The override is recorded in the activity log.
370
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
371
+ - `et staff-redemption stock summary` → `event.staffRedemption.getStaffRedemptionStockSummary` (query)
372
+ - Show sets and prizes issued and left per site and session, with per-slot item counts (items), roster headcount and how many of them collected, plus event-wide item totals.
373
+ - `et staff-redemption counter context` → `event.staffRedemption.getStaffRedemptionCounterContext` (query)
374
+ - Counter view for one site (siteId): the event (name, status, dates), items to choose from, the site's sessions with sets and prizes left, and any missing policies. Needs event.operate.
375
+ - `et staff-redemption lookup` → `event.staffRedemption.lookupStaffRedemptionEmployee` (mutation)
376
+ - Look up an Employee ID at a site: who they are, what they already collected and whether a redemption would go ahead (refusal code otherwise). Writes nothing but failed-lookup throttle records, so it needs no confirmation flags. Needs event.operate.
377
+ - `et staff-redemption redeem` → `event.staffRedemption.redeemStaffRedemption` (mutation)
378
+ - Redeem for an Employee ID at a site: records the chosen itemIds and reveals the prize outcome the server decides in the same transaction. clientRequestId is a UUID you generate; retry with the same one and you get the stored receipt, never a second redemption. Needs event.operate.
379
+ - Confirm: `--allow-state-change` `--target <input.eventId>`
380
+ - `et staff-redemption counter claims` → `event.staffRedemption.getStaffRedemptionCounterClaims` (query)
381
+ - List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. Needs event.operate.
308
382
 
309
383
  ## Procedures without a registry command
310
384
 
@@ -348,6 +422,7 @@ Run `et <command> --help` for the full input JSON Schema.
348
422
  - `event.luckyDraw.updateLuckyDrawPrizesOrder`: hand-written
349
423
  - `event.luckyDraw.updateLuckyDrawConfigJson`: hand-written
350
424
  - `event.passport.getPassportLoginOptions`: hand-written
425
+ - `event.passport.getPassportQueueStatuses`: hand-written
351
426
  - `event.passport.getStationPrintQr`: hand-written
352
427
  - `event.passport.issueStationPrintQr`: hand-written
353
428
  - `event.passport.revokeStationPrintQr`: hand-written
@@ -358,6 +433,7 @@ Run `et <command> --help` for the full input JSON Schema.
358
433
  - `event.passport.beginPassportGoogleLogin`: participant-only
359
434
  - `event.passport.joinPassport`: participant-only
360
435
  - `event.passport.getMyPassport`: hand-written
436
+ - `event.passport.getMyPassportPrizeStock`: participant-only
361
437
  - `event.passport.getMyPassportCode`: participant-only
362
438
  - `event.passport.getPassportParticipantDetail`: hand-written
363
439
  - `event.passport.getPassportOverview`: hand-written
@@ -404,6 +480,7 @@ Run `et <command> --help` for the full input JSON Schema.
404
480
  - `event.passport.redeemPrizeAsStationStaff`: browser-only
405
481
  - `event.passport.recordTallyAsStationStaff`: browser-only
406
482
  - `event.passport.setPassportStationPassword`: hand-written
483
+ - `event.passport.setStationQueueStatusAsStationStaff`: hand-written
407
484
  - `event.passport.signInToStationStaff`: browser-only
408
485
  - `event.scavengerHunt.getScavengerHuntByEventId`: frozen-scavenger-hunt
409
486
  - `event.scavengerHunt.getScavengerHuntBoardBackgroundByEventId`: frozen-scavenger-hunt
@@ -469,6 +546,10 @@ Run `et <command> --help` for the full input JSON Schema.
469
546
  - `event.scavengerHunt.team.restoreTeam`: frozen-scavenger-hunt
470
547
  - `event.scavengerHunt.team.getTeamsByEventId`: frozen-scavenger-hunt
471
548
  - `event.scavengerHunt.team.getTeamForNav`: frozen-scavenger-hunt
549
+ - `event.staffRedemption.importStaffRedemptionRoster`: hand-written
550
+ - `event.staffRedemption.getStaffRedemptionExportData`: hand-written
551
+ - `event.staffRedemption.getStaffRedemptionCounterAccess`: browser-only
552
+ - `event.staffRedemption.signInToStaffRedemptionCrew`: browser-only
472
553
  - `event.getEventForNav`: hand-written
473
554
  - `event.getEventsByOrgId`: hand-written
474
555
  - `event.createRecentEvent`: web-navigation