@go-labs-sg/event-tech 1.25.0 → 1.27.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
@@ -586,6 +593,16 @@ et event create --organization-id <org-id> --name "Example Staff Appreciation" \
586
593
  et staff-redemption settings update --allow-state-change --target <event-id> \
587
594
  --input '{"eventId":"<event-id>","eligibleShifts":["A","B","C","D"],"itemRule":"ONE_FROM_EACH_GROUP","wrongSite":"REFUSE","drawPolicy":"REMAINING_HEADCOUNT"}'
588
595
 
596
+ # 2b. Employee sign-in and counter wording (optional, never locked, never need overrideReason).
597
+ # loginMethods is the full object {emailOtp, google, guest, staffId, staffIdRequiresLastName};
598
+ # when absent every method is off, so employees cannot sign in to their QR page.
599
+ # google true is refused while Google login is not configured on the server.
600
+ # staffIdLabel (max 40) renames "Employee ID" on the employee page; wrongSiteMessage (max 300)
601
+ # is the counter warning shown when a person is rostered at another site. Send null (or an
602
+ # empty string) to either text to go back to the default.
603
+ et staff-redemption settings update --allow-state-change --target <event-id> \
604
+ --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."}'
605
+
589
606
  # 3. Sites, and one crew password per site (6-128 characters; this turns the site's crew link
590
607
  # on and ends that site's crew sessions). Keep the password out of shell history: put
591
608
  # {"eventId":"<event-id>","siteId":"<site-id>","password":"..."} in a file only you can
@@ -630,6 +647,13 @@ et staff-redemption setup get --input '{"eventId":"<event-id>"}' # missingPoli
630
647
  # UUID returns the stored receipt and never redeems twice.
631
648
  et staff-redemption lookup \
632
649
  --input '{"eventId":"<event-id>","siteId":"<site-id>","employeeId":"E1001"}'
650
+ # Or look a person up by the QR code from their employee page: send "code" instead of
651
+ # "employeeId" (exactly one of the two). The code is valid for 10 minutes plus 1 minute of
652
+ # grace after expiry; an invalid, expired or other-event code is refused and costs no failed-lookup attempt. The card then has
653
+ # awayFromRosterSite and rosterSiteId, and counter context returns wrongSite, wrongSiteMessage
654
+ # and staffIdLabel.
655
+ et staff-redemption lookup \
656
+ --input '{"eventId":"<event-id>","siteId":"<site-id>","code":"<scanned-code>"}'
633
657
  et staff-redemption redeem --allow-state-change --target <event-id> \
634
658
  --input "{\"eventId\":\"<event-id>\",\"siteId\":\"<site-id>\",\"employeeId\":\"E1001\",\"clientRequestId\":\"$(uuidgen | tr A-Z a-z)\",\"itemIds\":[\"<item-id>\"]}"
635
659
 
@@ -778,7 +802,21 @@ signed for one hour (`mediaUrlExpiresInSeconds`), so download media right after
778
802
  exporting; the raw S3 keys are included too. Other event types are rejected with a pointer to
779
803
  `et event export`. Nothing creates or edits these events.
780
804
 
781
- ### Event appearance and Photo Wall display
805
+ ### Event appearance and fullscreen displays
806
+
807
+ The event theme (colours and font) and display image/video apply to Photo Wall,
808
+ Post-it Note, Signature Wall, Human Bingo and Rating boards. Appearance
809
+ includes a sample screen preview for each. Dedicated desktop configuration
810
+ previews use that same saved display theme and background.
811
+
812
+ Photo Wall, Post-it Note and Signature Wall share the existing presentation
813
+ settings under `photoWall`: `durationSeconds` (10–40), `maxVisible` (1–16,
814
+ subject to available display space), and `motion` (`gentle`, `lively`, or
815
+ `roaming`, which bounces contributions off one another and the display edges).
816
+ These fields belong to the selected event; note and signature events do not
817
+ gain photo-submission, QR or screen-canvas options. Change them through
818
+ Settings → Appearance → Wall animation or the existing appearance update command.
819
+ Resetting Appearance restores the default theme and playback settings.
782
820
 
783
821
  `event appearance get` returns the canonical appearance, its optimistic-lock
784
822
  version, and resolved media URLs. It uses the authenticated event procedure by
@@ -793,6 +831,31 @@ et event appearance update \
793
831
  --appearance '{"version":1,"theme":{"accentColor":"#f84404","backgroundColor":"#f6f7f9","textColor":"#20242a","fontFamily":"SYSTEM"},"guestBackground":{"type":"none","key":null},"displayBackground":{"type":"none","key":null},"photoWall":{"durationSeconds":18,"maxVisible":4,"motion":"gentle","showQrCode":true,"showEventName":true}}'
794
832
  ```
795
833
 
834
+ Human Bingo display copy and sizing use the optional `humanBingo` appearance
835
+ block. Read `event appearance get` first and retain its other settings in the
836
+ full JSON update; pass its current `appearanceVersion` through
837
+ `--appearance-version` (3 in this example):
838
+
839
+ ```sh
840
+ et event appearance update \
841
+ --event-id <id> \
842
+ --appearance-version 3 \
843
+ --appearance '{"version":1,"theme":{"accentColor":"#f84404","backgroundColor":"#f6f7f9","textColor":"#20242a","fontFamily":"SYSTEM"},"guestBackground":{"type":"none","key":null},"displayBackground":{"type":"none","key":null},"photoWall":{"durationSeconds":18,"maxVisible":4,"motion":"gentle","showQrCode":true,"showEventName":true},"humanBingo":{"title":"Meet your team","joinHeading":"Scan to join","joinInstructions":"Open your camera, scan the QR code and enter your name.","titleFontSize":64,"nameFontSize":40}}'
844
+ ```
845
+
846
+ Adding `humanBingo: {}` explicitly opts into the new display defaults. Text is
847
+ trimmed: `title` allows up to 80 characters and defaults to empty (use the
848
+ existing configured Bingo title); `joinHeading` requires 1–40 characters and
849
+ defaults to `Scan to join`; `joinInstructions` requires 1–180 characters and
850
+ defaults to `Open your camera, scan the QR code and enter your name.`.
851
+ `titleFontSize` is an integer from 32–96 (default 64), and `nameFontSize` is an
852
+ integer from 24–52 (default 40). Colors, fonts and backgrounds use the canonical
853
+ event theme and appearance media settings. Omitting `humanBingo` on save preserves
854
+ the stored block; an event without the block keeps its legacy layout and title.
855
+ Use appearance reset to clear all overrides and restore legacy Bingo behavior.
856
+ `human-bingo config get` and `human-bingo config update` continue to manage the
857
+ configured Bingo title and game rules.
858
+
796
859
  Reset is an explicit, version-fenced null update:
797
860
 
798
861
  ```sh
@@ -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; 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. 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.
@@ -373,9 +373,9 @@ Run `et <command> --help` for the full input JSON Schema.
373
373
  - `et staff-redemption stock summary` → `event.staffRedemption.getStaffRedemptionStockSummary` (query)
374
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.
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