feat(casino): add admin game and player activity reporting - #42
Merged
marek-chmielowski-blurify merged 3 commits intoJul 28, 2026
Conversation
Adds admin-facing reporting for game performance and player activity across gaming, iam, and admin-console modules, with the supporting contracts, adapters, and drizzle migration. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AQEMZKrp4ik3gEddK5McH6
marek-chmielowski-blurify
requested review from
agniev-a-hub,
klaudia-blazyczek-blurify and
zaxovaiko
as code owners
July 28, 2026 06:25
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
zaxovaiko
reviewed
Jul 28, 2026
…r-analytics # Conflicts: # packages/core/src/casino/gaming/__tests__/gaming.service.test.ts
zaxovaiko
approved these changes
Jul 28, 2026
2 tasks
marek-chmielowski-blurify
added a commit
that referenced
this pull request
Jul 31, 2026
## Summary Resolves all 10 unresolved review comments left on #42 (merged without addressing them). - Removed superfluous comments that only restated what `AGENTS.md`/naming already documents (`game.ts`, `admin-player-activity.ts`) - Deduped `GAME_PERFORMANCE_SORT_FIELDS` between the contract port and admin-console (import from `@openora/core/contracts` instead of redeclaring) - Added a `currency` filter to the game-performance report instead of summing bet/win amounts across currencies - Rewrote DAU/WAU/MAU to a single `LEFT JOIN` + `FILTER` instead of three correlated subqueries per generated day - Fixed a retention off-by-one: the registration-day session no longer counts as a return; the window now starts the day after registration - Replaced hardcoded snake_case SQL identifiers with Drizzle column references in the retention query - Added a `TODO` documenting that `winAmount` is never set yet (`endRound` has no way to report a win), so revenue currently always equals volume - Rewrote the `DrizzleAdminGameReporting`, `DrizzleAdminPlayerActivity`, and `BackofficeService.getGamePerformance` test suites against real Postgres instead of mocked query builders/ports ## Test plan - [x] `pnpm verify` (types, lint, boundaries, shape, deprecations, unit tests, drift) - green - [x] New/rewritten real-Postgres tests cover: DAU/WAU/MAU correctness, retention window fix, currency filter, zero-activity edge cases --------- Co-authored-by: Marek Chmielowski <marek.chmielowski@blurify.com>
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
AdminGameReporting) and player activity (admin-player-activityadapter) acrosscasino/gaming,iam, andadmin-consoleadmin-game-reporting.ts,admin-player-activity.ts,game.ts) and a Drizzle migration for the supporting queriesadmin-console's router/service so the backoffice can consume game performance + player activity data (consumed by the betfeelfeat/bf-218-game-player-analyticsMR)devto pick up the intervening stake-debit and cooling-off work incasino/gaming; resolved conflicts inplugin.ts(merged DI wiring),contracts/schemas/common.ts(both additions kept), andgaming.service.test.ts(unified theGAME_ROWfixture with the newgameTypefield)docs/catalog.jsonto reflect current routesTest plan
pnpm verify(types, lint, format, boundaries, module-shape, deprecations, unit tests, tool tests) — 17/17 tasks greenpnpm verify:drift— catalog/openapi regeneration clean