feat(minigames): add draw lots and scratch-off minigame types - #1085
Merged
Conversation
Draw Lots and Scratch Off join Jackpot/Lucky Wheel/Gashapon as playable minigame types (config, preview art, play screens, default assets). Supporting changes: - Track playsCount/participantsCount/winnersCount on Minigame and surface them as sortable columns in the minigames list. - Record the ContactInbox a play came from (MinigameContact.contactInboxId) so the history table can jump straight to the originating conversation instead of guessing by channel; resolveOpenerPlayState wraps the opener-tracking insert and participantsCount increment in one transaction. - Scope contactInboxService.listByContactId/findRecentByContactId by workspaceId (cache key and query) to avoid cross-workspace ambiguity now that more call sites depend on the result being workspace-correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Minigame.playsCount/participantsCount/winnersCount) and shown as sortable columns in the minigames list.MinigameContact.contactInboxIdcolumn instead of guessing by channel.contactInboxService.listByContactId/findRecentByContactIdare now scoped byworkspaceId(cache key + query) to remove cross-workspace ambiguity now that more call sites depend on the result.Changes
apps/builder/src/features/minigames/**: new Draw Lots / Scratch Off config, preview, and play-screen components; registries updated; minigames list adds plays/participants/winners columns; history table adds "jump to conversation" action.packages/minigame-ui: newdraw-lots-artandscratch-off-artcomponents.packages/database:Minigamegains counter columns;MinigameContactgainscontactInboxId(FK toContactInbox); new migrations20260903155650_add-contact-inbox-id-to-minigame-contactand a regenerated20260903024507_error_log_indexes.packages/business:minigameContactService.recordPlay/resolvePlayStatetrackcontactInboxIdand update counters; newresolveOpenerPlayStatewraps opener tracking in a transaction;contactInboxServiceandconversationService.findDMByContactInboxsupport workspace-scoped, inbox-aware conversation lookup.apps/worker,packages/variables,apps/builder/src/features/messages: updated call sites for the newworkspaceId-scopedcontactInboxServicemethods.apps/builder/messages/*.jsonlocale files updated with new translation keys.Test plan
pnpm lintpnpm --filter builder check-types