@go-labs-sg/event-tech 1.29.0 → 1.31.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
@@ -552,8 +552,10 @@ need `event.setup`, the export needs `event.export`, and the counter commands (`
552
552
  `lookup`, `redeem`, `claims record-items`) need `event.operate`. Site crew sign in with a site password in the browser
553
553
  only; crew sign-in and the counter access check have no CLI command. The same goes for the
554
554
  employee QR page: employee sign-in (Employee ID, email code, Google, guest), claiming an Employee
555
- ID, reading the employee's own QR code and the sign-in options are participant-only procedures
556
- used by the web page and have no `et` command. Their settings are managed with
555
+ ID, reading the employee's own QR code with their food choices, the sign-in options and the
556
+ page's problem report (QR did not show, device check, Reload page) are participant-only procedures
557
+ used by the web page and have no `et` command. What the page reported is read back with
558
+ `device-issues list` and `device-issues counts`. Their settings are managed with
557
559
  `settings update` (`loginMethods`, `staffIdLabel`, `wrongSiteMessage`) and read back with
558
560
  `setup get` (`config.loginMethods`, `employeeLogin.googleAvailable`). The Lucky Draw and Food
559
561
  Collection counter pages use the same `counter context`, `lookup`, `redeem` and
@@ -568,6 +570,7 @@ confirm every write with `--allow-state-change --target <event-id>`. The command
568
570
  | 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` |
569
571
  | Roster | `roster list`, `roster counts`, `roster upsert`, `roster import` |
570
572
  | Redemption log | `claims list`, `claims counts`, `claims void`, `claims record-items`, `draw release`, `stock summary`, `export` |
573
+ | Employee QR problems | `device-issues list`, `device-issues counts` |
571
574
  | Counter | `counter context`, `lookup`, `redeem`, `counter claims` |
572
575
 
573
576
  A walkthrough with made-up names and IDs. Nothing here is an instruction to change a live event;
@@ -593,8 +596,11 @@ et event create --organization-id <org-id> --name "Example Staff Appreciation" \
593
596
  # from their own shift's slot's prizes there. A walk-in rostered at another site (or
594
597
  # none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their
595
598
  # own shift's slot at the counter's site while their session is open and it has sets
596
- # left, else the open session's slot there with the most sets left, and always spins for
597
- # no prize. card.setSession and card.setsFromOtherSession say which slot gives the set,
599
+ # left, else the open session's slot there with the most sets left, and spins for no
600
+ # prize unless walkInDraw is AT_COUNTER_SITE (#2549; with wrongSite SERVE_FROM_COUNTER
601
+ # and drawPolicy REMAINING_HEADCOUNT a walk-in then draws from the prizes of the slot
602
+ # their set comes from, odds left / (H + 1); unset or NO_PRIZE keeps the no-prize spin).
603
+ # card.setSession and card.setsFromOtherSession say which slot gives the set,
598
604
  # card.prizesHere whether the spin can win, and card.ownSessionTiming warns NOT_STARTED
599
605
  # or ENDED when their own session is not open. Session times decide which other
600
606
  # sessions' stock is usable: set them correctly. Both draws work with either session
@@ -690,6 +696,15 @@ et staff-redemption claims list --input '{"eventId":"<event-id>","status":"items
690
696
  # draw release is refused while an active redemption still shows the draw (claims list
691
697
  # draw.activeClaimCount > 0): void that redemption first.
692
698
  et staff-redemption claims list --input '{"eventId":"<event-id>","search":"E1001"}'
699
+ # Employee QR problems. When an employee's QR does not show or their device has a problem, the
700
+ # page logs it (kind, device problems found, page state, the person when signed in, a device
701
+ # snapshot). Read them newest first, one cursor page per call (limit 1-100, default 50), optionally
702
+ # one kind (qr-not-visible, qr-render-failed, qr-refresh-failed, qr-expired, page-load-failed,
703
+ # device-problem, reload-tapped). The output is { items, pageInfo }; pass pageInfo.nextCursor as
704
+ # cursor for the next page. `counts` gives totalCount, allCount and the count per kind. Needs
705
+ # event.setup.
706
+ et staff-redemption device-issues list --input '{"eventId":"<event-id>","kind":"qr-not-visible","limit":50}'
707
+ et staff-redemption device-issues counts --input '{"eventId":"<event-id>"}'
693
708
  et staff-redemption claims void --allow-state-change --target <event-id> \
694
709
  --input '{"eventId":"<event-id>","claimId":"<claim-id>","reason":"Wrong items handed over"}'
695
710
  et staff-redemption draw release --allow-state-change --target <event-id> \
@@ -796,7 +811,9 @@ it with the filters.
796
811
  this site a redemption would use now; null, with `setsFromOtherSession` false, on a card refused
797
812
  before sets are counted), `setsFromOtherSession`, `prizesHere` (false when the spin here can only
798
813
  be no prize: no slot for their shift at this site, or under `ANY_OPEN_SESSION` they are rostered
799
- at another site) and `ownSessionTiming` (`NOT_STARTED`, `ENDED` or null; `ANY_OPEN_SESSION` only, a
814
+ at another site, unless `walkInDraw` is `AT_COUNTER_SITE`), `walkInPrizeDraw` (true when a walk-in
815
+ draws from `setSession`'s prizes at this site under `walkInDraw` `AT_COUNTER_SITE`) and
816
+ `ownSessionTiming` (`NOT_STARTED`, `ENDED` or null; `ANY_OPEN_SESSION` only, a
800
817
  warning: a person rostered here still uses their own shift's sets and prizes, a walk-in gets an
801
818
  open session's set and a no-prize spin).
802
819
  `card.session` is now always the person's own shift's session (their prizes), and
@@ -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, 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.
311
+ - Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set, walkInDraw, always resolved: NO_PRIZE 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, 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, from its sets and prizes) or ANY_OPEN_SESSION ('any open session: own shift's stock first'. A person rostered at the counter's site gets their set, from their session's (Singapore) day onwards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot there while it has sets left, else from the slot at the same site of the open session with the most sets left (NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes there; they are never refused NO_OPEN_SESSION. A walk-in rostered at another site (or none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot at the counter's site while their session is open and it has sets left, else from the open session's slot there with the most sets left, and their spin is always no prize; works with either drawPolicy, and under REMAINING_HEADCOUNT a site's prizes are shared only over its own people). 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.
313
+ - Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, walkInDraw, 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, from its sets and prizes) or ANY_OPEN_SESSION ('any open session: own shift's stock first'. A person rostered at the counter's site gets their set, from their session's (Singapore) day onwards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot there while it has sets left, else from the slot at the same site of the open session with the most sets left (NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes there; they are never refused NO_OPEN_SESSION. A walk-in rostered at another site (or none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot at the counter's site while their session is open and it has sets left, else from the open session's slot there with the most sets left, and their spin is no prize unless walkInDraw is AT_COUNTER_SITE; works with either drawPolicy, and under REMAINING_HEADCOUNT a site's prizes are shared only over its own people). walkInDraw is NO_PRIZE (the default when unset) or AT_COUNTER_SITE: under ANY_OPEN_SESSION with wrongSite SERVE_FROM_COUNTER and drawPolicy REMAINING_HEADCOUNT, a walk-in draws from the prizes of the counter site's slot their set comes from, added to that slot's people (odds prizes left / (headcount + 1)), so each walk-in win is one fewer prize for that site's own people; ignored (no prize) under any other combination. 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, walkInDraw 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,17 +371,21 @@ 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 the stock of the slot it was drawn in (claims list draw.slot) 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, walk-ins (walkIns: unreleased draws in the slot by people whose roster site or shift is not the slot's, leaving out no-prize draws by another shift, which are the placeholders recorded where a set came from when no prize slot could be used) and how many of them won (walkInPrizes; under ANY_OPEN_SESSION walk-ins from another site spin for no prize since 19 Nov 2026, so it only counts earlier draws there), 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, leaving out no-prize draws by another shift, which are the placeholders recorded where a set came from when no prize slot could be used) and how many of them won (walkInPrizes; under ANY_OPEN_SESSION walk-ins from another site spin for no prize since 19 Nov 2026 unless walkInDraw is AT_COUNTER_SITE, so otherwise it only counts earlier draws there), plus event-wide item totals.
375
375
  - `et staff-redemption counter context` → `event.staffRedemption.getStaffRedemptionCounterContext` (query)
376
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, openSessionIds are the sessions open now and openSessionChangesAt when that next changes (serverTime is the server clock at the read); openSession (the open session that started most recently) is informational only, as no single session serves everyone (a person rostered at the site uses their own shift's slot from that session's Singapore day onwards, whatever the hour; walk-ins and people whose session is on a later day use only open sessions' stock). Needs event.operate.
377
377
  - `et staff-redemption lookup` → `event.staffRedemption.lookupStaffRedemptionEmployee` (mutation)
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), their own shift's session (card.session, the only one whose prizes they can draw from), the session whose sets at this site a redemption would use now (card.setSession, with card.setsFromOtherSession true when it is not their own; both null and false on a card refused before sets are counted; card.slotSetsLeft is what is left in it), card.prizesHere (false when the spin here can only be no prize: no slot for their shift at this site, or under ANY_OPEN_SESSION they are rostered at another site or their own session is on a later Singapore day), card.heldDraw (their unreleased draw from an earlier, voided redemption, shown again instead of a new spin; null when the next redemption draws afresh), card.ownSessionTiming (ANY_OPEN_SESSION only: NOT_STARTED or ENDED when their own session is not open, a warning; a person rostered here whose session has started or is due that Singapore day still uses their own shift's sets and prizes, while a walk-in or a person whose session is on a later day gets an open session's set and a no-prize spin; null otherwise) and whether a redemption would go ahead (refusal code otherwise). Writes nothing and is not rate-limited, 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), their own shift's session (card.session, the only one whose prizes they can draw from), the session whose sets at this site a redemption would use now (card.setSession, with card.setsFromOtherSession true when it is not their own; both null and false on a card refused before sets are counted; card.slotSetsLeft is what is left in it), card.prizesHere (false when the spin here can only be no prize: no slot for their shift at this site, or under ANY_OPEN_SESSION they are rostered at another site or their own session is on a later Singapore day and walkInDraw is not AT_COUNTER_SITE), card.walkInPrizeDraw (true when such a walk-in draws from card.setSession's prizes at this site instead, walkInDraw AT_COUNTER_SITE), card.heldDraw (their unreleased draw from an earlier, voided redemption, shown again instead of a new spin; null when the next redemption draws afresh), card.ownSessionTiming (ANY_OPEN_SESSION only: NOT_STARTED or ENDED when their own session is not open, a warning; a person rostered here whose session has started or is due that Singapore day still uses their own shift's sets and prizes, while a walk-in or a person whose session is on a later day gets an open session's set and a no-prize spin; null otherwise) and whether a redemption would go ahead (refusal code otherwise). Writes nothing and is not rate-limited, 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. The set and the draw follow the event's sessionRule. Under ANY_OPEN_SESSION a person rostered at this site gets the set, from their session's (Singapore) day onwards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot here while it has sets left, else the open session's slot here with the most sets left (receipt.session names it; NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes here; a walk-in rostered at another site is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot here while their session is open and it has sets left, else the open session's slot here with the most sets left, and always gets no prize. receipt.draw.slot is the slot, session and site the draw was made in (a reused draw keeps its own). 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>`
382
382
  - `et staff-redemption claims record-items` → `event.staffRedemption.recordStaffRedemptionClaimItems` (mutation)
383
383
  - Record the food (itemIds, checked against the item rule) for a claim that was drawn first (itemsPending true, counterOrder DRAW_THEN_FOOD). siteId must be the claim's own site (claims list shows it). Writes the items, sets itemsPending false and itemsRecordedAt, and logs it; it deducts no set and makes no draw. Idempotent: the same items again return replayed true with the stored receipt. CONFLICT when different items were already recorded, when the claim is voided, or when the claim was food-first (nothing pending). Needs event.operate at that site (a manager has it). Returns status recorded, replayed and the receipt.
384
384
  - Confirm: `--allow-state-change` `--target <input.eventId>`
385
+ - `et staff-redemption device-issues list` → `event.staffRedemption.getStaffRedemptionDeviceIssues` (query)
386
+ - List the problems the employee QR page reported, newest first, one cursor page per call (limit 1-100, default 50; cursor and direction forward from the previous pageInfo.nextCursor; optional kind filter; a cursor from other filters is rejected, so restart without it): returns { items, pageInfo: { hasNextPage, nextCursor } }. Each item has id, createdAt, kind (qr-not-visible, qr-render-failed, qr-refresh-failed, qr-expired, page-load-failed, device-problem or reload-tapped), problems found by the device check (offline, site-data-blocked, in-app-browser, forced-colors, forced-dark-mode, old-browser, data-saver, clock-wrong), detail, pageState, employeeId and employeeName when the browser was signed in as an employee, the device snapshot (browser, OS, screen, viewport, language, time zone, connection, clockOffsetMs and more), userAgent and ipAddress. Totals are in device-issues counts. Holds names and device details; needs event.setup.
387
+ - `et staff-redemption device-issues counts` → `event.staffRedemption.getStaffRedemptionDeviceIssueCounts` (query)
388
+ - Count the employee QR page reports for the same optional kind filter as device-issues list: returns totalCount (follows the kind filter), allCount (every report of the event) and counts (reports per kind, never filtered). Needs event.setup.
385
389
  - `et staff-redemption counter claims` → `event.staffRedemption.getStaffRedemptionCounterClaims` (query)
386
390
  - 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. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.
387
391
 
@@ -499,6 +503,7 @@ Run `et <command> --help` for the full input JSON Schema.
499
503
  - `event.staffRedemption.beginStaffRedemptionEmployeeGoogleLogin`: participant-only
500
504
  - `event.staffRedemption.claimStaffRedemptionEmployee`: participant-only
501
505
  - `event.staffRedemption.getMyStaffRedemptionEmployee`: participant-only
506
+ - `event.staffRedemption.reportStaffRedemptionEmployeeIssue`: participant-only
502
507
  - `event.getEventForNav`: hand-written
503
508
  - `event.getEventsByOrgId`: hand-written
504
509
  - `event.createRecentEvent`: web-navigation