@go-labs-sg/event-tech 1.26.0 → 1.28.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
@@ -551,7 +551,14 @@ items handed over and reveal a prize outcome the server decides in the same tran
551
551
  Everything uses the same tRPC procedures and permissions as the web app. Setup and the roster
552
552
  need `event.setup`, the export needs `event.export`, and the counter commands (`counter`,
553
553
  `lookup`, `redeem`, `claims record-items`) need `event.operate`. Site crew sign in with a site password in the browser
554
- only; crew sign-in and the counter access check have no CLI command.
554
+ only; crew sign-in and the counter access check have no CLI command. The same goes for the
555
+ employee QR page: employee sign-in (Employee ID, email code, Google, guest), claiming an Employee
556
+ ID, reading the employee's own QR code and the sign-in options are participant-only procedures
557
+ used by the web page and have no `et` command. Their settings are managed with
558
+ `settings update` (`loginMethods`, `staffIdLabel`, `wrongSiteMessage`) and read back with
559
+ `setup get` (`config.loginMethods`, `employeeLogin.googleAvailable`). The Lucky Draw and Food
560
+ Collection counter pages use the same `counter context`, `lookup`, `redeem` and
561
+ `claims record-items` commands as the combined counter.
555
562
 
556
563
  All commands except `roster import` and `export` are registry commands: pass the procedure input
557
564
  with `--input`/`--input-file`, run `et staff-redemption <command> --help` for the schema, and
@@ -579,13 +586,26 @@ et event create --organization-id <org-id> --name "Example Staff Appreciation" \
579
586
  # SERVE_FROM_COUNTER) and the draw (REMAINING_HEADCOUNT, or FIXED_RATE with
580
587
  # fixedWinRatePercent). sessionRule is optional: OWN_SHIFT (the default) serves people
581
588
  # only during their own shift's session; ANY_OPEN_SESSION serves them during whichever
582
- # session is open now, from that session's sets. counterOrder is optional too:
589
+ # session is open now, from that session's sets and prizes. Both draws work with either
590
+ # session rule; under REMAINING_HEADCOUNT a walk-in from another shift or site draws from
591
+ # the open session's prizes as one extra person, so heavy walk-in traffic can use up
592
+ # prizes before that session's last arrivals. counterOrder is optional too:
583
593
  # FOOD_THEN_DRAW (the default when unset: items first, then the wheel) or DRAW_THEN_FOOD
584
594
  # (spin first, record the food afterwards). They lock once the first redemption exists;
585
595
  # changing them then needs overrideReason.
586
596
  et staff-redemption settings update --allow-state-change --target <event-id> \
587
597
  --input '{"eventId":"<event-id>","eligibleShifts":["A","B","C","D"],"itemRule":"ONE_FROM_EACH_GROUP","wrongSite":"REFUSE","drawPolicy":"REMAINING_HEADCOUNT"}'
588
598
 
599
+ # 2b. Employee sign-in and counter wording (optional, never locked, never need overrideReason).
600
+ # loginMethods is the full object {emailOtp, google, guest, staffId, staffIdRequiresLastName};
601
+ # when absent every method is off, so employees cannot sign in to their QR page.
602
+ # google true is refused while Google login is not configured on the server.
603
+ # staffIdLabel (max 40) renames "Employee ID" on the employee page; wrongSiteMessage (max 300)
604
+ # is the counter warning shown when a person is rostered at another site. Send null (or an
605
+ # empty string) to either text to go back to the default.
606
+ et staff-redemption settings update --allow-state-change --target <event-id> \
607
+ --input '{"eventId":"<event-id>","loginMethods":{"emailOtp":true,"google":false,"guest":false,"staffId":true,"staffIdRequiresLastName":true},"staffIdLabel":"Employee ID","wrongSiteMessage":"This person is rostered at another site. You may still serve them."}'
608
+
589
609
  # 3. Sites, and one crew password per site (6-128 characters; this turns the site's crew link
590
610
  # on and ends that site's crew sessions). Keep the password out of shell history: put
591
611
  # {"eventId":"<event-id>","siteId":"<site-id>","password":"..."} in a file only you can
@@ -630,6 +650,13 @@ et staff-redemption setup get --input '{"eventId":"<event-id>"}' # missingPoli
630
650
  # UUID returns the stored receipt and never redeems twice.
631
651
  et staff-redemption lookup \
632
652
  --input '{"eventId":"<event-id>","siteId":"<site-id>","employeeId":"E1001"}'
653
+ # Or look a person up by the QR code from their employee page: send "code" instead of
654
+ # "employeeId" (exactly one of the two). The code is valid for 10 minutes plus 1 minute of
655
+ # grace after expiry; an invalid, expired or other-event code is refused and costs no failed-lookup attempt. The card then has
656
+ # awayFromRosterSite and rosterSiteId, and counter context returns wrongSite, wrongSiteMessage
657
+ # and staffIdLabel.
658
+ et staff-redemption lookup \
659
+ --input '{"eventId":"<event-id>","siteId":"<site-id>","code":"<scanned-code>"}'
633
660
  et staff-redemption redeem --allow-state-change --target <event-id> \
634
661
  --input "{\"eventId\":\"<event-id>\",\"siteId\":\"<site-id>\",\"employeeId\":\"E1001\",\"clientRequestId\":\"$(uuidgen | tr A-Z a-z)\",\"itemIds\":[\"<item-id>\"]}"
635
662
 
@@ -734,8 +761,11 @@ it with the filters.
734
761
  2,000 slots, 100 item groups, 200 items per group, 200 prizes, 10,000 prize stock rows).
735
762
  - `stock summary` adds `truncated` and, to each `slots[]` row, `headcount` (active roster people
736
763
  whose roster site and shift are the slot's), `collected` (how many of them have an active claim
737
- anywhere) and `items` (`[{ "itemId", "handedOut" }]`, only items handed out in that slot; voided
738
- claims are not counted).
764
+ anywhere), `items` (`[{ "itemId", "handedOut" }]`, only items handed out in that slot; voided
765
+ claims are not counted), `walkIns` (unreleased draws in the slot by people whose roster site or
766
+ shift, as the roster reads now, is not the slot's) and `walkInPrizes` (how many of those won).
767
+ Under `REMAINING_HEADCOUNT` each walk-in draws as one extra person, so `walkInPrizes` is roughly
768
+ how many fewer prizes the slot's own people share.
739
769
  - `claims list` and `export` rows carry `groupName` on each item and `awayFromRosterSite` (true
740
770
  when the person was served at a site other than their roster site; false when their roster
741
771
  site matches no site). The CSV export adds "Roster site" and "Away from roster site" columns
@@ -308,9 +308,9 @@ Run `et <command> --help` for the full input JSON Schema.
308
308
  - Approve or reject a Human Bingo card item submission.
309
309
  - Confirm: `--allow-state-change` `--target <input.id>`
310
310
  - `et staff-redemption setup get` → `event.staffRedemption.getStaffRedemptionSetup` (query)
311
- - Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set), 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.
311
+ - Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set, and the employee sign-in settings loginMethods, staffIdLabel and wrongSiteMessage, the two texts null while unset), employeeLogin.googleAvailable (whether Google sign-in can be turned on), 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.
312
312
  - `et staff-redemption settings update` → `event.staffRedemption.updateStaffRedemptionSettings` (mutation)
313
- - Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent and counterOrder; omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session) or ANY_OPEN_SESSION (whichever session is open now, from that session's sets; needs drawPolicy FIXED_RATE). counterOrder is FOOD_THEN_DRAW (the default when never set) or DRAW_THEN_FOOD (the person spins first and the food is recorded afterwards); it is not a required policy (never in missingPolicies). Policies, sessionRule and counterOrder included, lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log.
313
+ - Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent, counterOrder and the employee sign-in settings loginMethods (emailOtp, google, guest, staffId, staffIdRequiresLastName; every method is off until turned on; google needs the server's Google sign-in), staffIdLabel (what the roster identifier is called, default 'Employee ID') and wrongSiteMessage (the warning both counters show for a person rostered at another site, max 300 characters); null or blank resets a text to its default. Omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session) or ANY_OPEN_SESSION (whichever session is open now, from that session's sets and prizes; works with either drawPolicy, and under REMAINING_HEADCOUNT a walk-in from another shift or site draws from the open session's prizes as one extra person, so heavy walk-in traffic can use up prizes before that session's last arrivals). counterOrder is FOOD_THEN_DRAW (the default when never set) or DRAW_THEN_FOOD (the person spins first and the food is recorded afterwards); it is not a required policy (never in missingPolicies). Policies, sessionRule and counterOrder included, lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log. loginMethods, staffIdLabel and wrongSiteMessage are not policies: they never lock and never need overrideReason.
314
314
  - Confirm: `--allow-state-change` `--target <input.eventId>`
315
315
  - `et staff-redemption site upsert` → `event.staffRedemption.upsertStaffRedemptionSite` (mutation)
316
316
  - Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.
@@ -371,11 +371,11 @@ Run `et <command> --help` for the full input JSON Schema.
371
371
  - 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.
372
372
  - Confirm: `--allow-state-change` `--target <input.eventId>`
373
373
  - `et staff-redemption stock summary` → `event.staffRedemption.getStaffRedemptionStockSummary` (query)
374
- - 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.
374
+ - 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, walk-ins (walkIns: unreleased draws in the slot by people whose roster site or shift is not the slot's) and how many of them won (walkInPrizes), plus event-wide item totals.
375
375
  - `et staff-redemption counter context` → `event.staffRedemption.getStaffRedemptionCounterContext` (query)
376
- - Counter view for one site (siteId): the event (name, status, dates), counterOrder (FOOD_THEN_DRAW or DRAW_THEN_FOOD, the order crew follow), items to choose from, the site's sessions with sets and prizes left, and any missing policies. sessionRule is the session policy; under ANY_OPEN_SESSION, openSession is the session every counter serves from now (null when none is open) and openSessionChangesAt when that next changes (serverTime is the server clock at the read). Needs event.operate.
376
+ - Counter view for one site (siteId): the event (name, status, dates), counterOrder (FOOD_THEN_DRAW or DRAW_THEN_FOOD, the order crew follow), items to choose from, the site's sessions with sets and prizes left, and any missing policies. wrongSite is the policy for people rostered at another site (null while unset), wrongSiteMessage the warning to show for them and staffIdLabel what the roster identifier is called (defaults applied). sessionRule is the session policy; under ANY_OPEN_SESSION, openSession is the session every counter serves from now (null when none is open) and openSessionChangesAt when that next changes (serverTime is the server clock at the read). Needs event.operate.
377
377
  - `et staff-redemption lookup` → `event.staffRedemption.lookupStaffRedemptionEmployee` (mutation)
378
- - Look up an Employee ID at a site: who they are, what they already collected (a collected card's receipt carries itemsPending and itemsRecordedAt), the session whose sets would be used (card.session; under ANY_OPEN_SESSION with none open, the next to open or else the last to close) 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.
378
+ - Look up an Employee ID (employeeId) or a scanned employee QR code (code, from the employee page; valid for ten minutes, refused with a message to refresh when expired or forged) at a site, giving exactly one of the two: who they are, the card's awayFromRosterSite and rosterSiteId (true when their roster site is not this site), what they already collected (a collected card's receipt carries itemsPending and itemsRecordedAt), the session whose sets would be used (card.session; under ANY_OPEN_SESSION with none open, the next to open or else the last to close) 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.
379
379
  - `et staff-redemption redeem` → `event.staffRedemption.redeemStaffRedemption` (mutation)
380
380
  - 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. When the event's counterOrder is DRAW_THEN_FOOD, itemIds must be [] (anything else is BAD_REQUEST): the claim, the set and the prize draw are recorded together and the receipt has itemsPending true until staff-redemption claims record-items. The item rule is not checked at the spin. Needs event.operate.
381
381
  - Confirm: `--allow-state-change` `--target <input.eventId>`
@@ -493,6 +493,12 @@ Run `et <command> --help` for the full input JSON Schema.
493
493
  - `event.staffRedemption.getStaffRedemptionExportData`: hand-written
494
494
  - `event.staffRedemption.getStaffRedemptionCounterAccess`: browser-only
495
495
  - `event.staffRedemption.signInToStaffRedemptionCrew`: browser-only
496
+ - `event.staffRedemption.getStaffRedemptionEmployeeLoginOptions`: participant-only
497
+ - `event.staffRedemption.signInToStaffRedemptionEmployee`: participant-only
498
+ - `event.staffRedemption.requestStaffRedemptionEmployeeEmailOtp`: participant-only
499
+ - `event.staffRedemption.beginStaffRedemptionEmployeeGoogleLogin`: participant-only
500
+ - `event.staffRedemption.claimStaffRedemptionEmployee`: participant-only
501
+ - `event.staffRedemption.getMyStaffRedemptionEmployee`: participant-only
496
502
  - `event.getEventForNav`: hand-written
497
503
  - `event.getEventsByOrgId`: hand-written
498
504
  - `event.createRecentEvent`: web-navigation