Skip to content

feat(casino): add admin game and player activity reporting - #42

Merged
marek-chmielowski-blurify merged 3 commits into
devfrom
feat/bf-218-game-player-analytics
Jul 28, 2026
Merged

feat(casino): add admin game and player activity reporting#42
marek-chmielowski-blurify merged 3 commits into
devfrom
feat/bf-218-game-player-analytics

Conversation

@marek-chmielowski-blurify

Copy link
Copy Markdown
Collaborator

Summary

  • Adds admin-facing reporting for game performance (AdminGameReporting) and player activity (admin-player-activity adapter) across casino/gaming, iam, and admin-console
  • New contracts/schemas (admin-game-reporting.ts, admin-player-activity.ts, game.ts) and a Drizzle migration for the supporting queries
  • Wires the new adapters through admin-console's router/service so the backoffice can consume game performance + player activity data (consumed by the betfeel feat/bf-218-game-player-analytics MR)
  • Rebased onto dev to pick up the intervening stake-debit and cooling-off work in casino/gaming; resolved conflicts in plugin.ts (merged DI wiring), contracts/schemas/common.ts (both additions kept), and gaming.service.test.ts (unified the GAME_ROW fixture with the new gameType field)
  • Regenerated docs/catalog.json to reflect current routes

Test plan

  • pnpm verify (types, lint, format, boundaries, module-shape, deprecations, unit tests, tool tests) — 17/17 tasks green
  • pnpm verify:drift — catalog/openapi regeneration clean

Marek Chmielowski and others added 2 commits July 28, 2026 08:15
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
Comment thread packages/core/src/iam/adapters/admin-player-activity.ts
Comment thread packages/core/src/contracts/schemas/game.ts
Comment thread packages/core/src/casino/gaming/__tests__/admin-reporting.test.ts
Comment thread packages/core/src/casino/gaming/admin-reporting.ts
Comment thread packages/core/src/admin-console/contract/index.ts
Comment thread packages/core/src/iam/adapters/admin-player-activity.ts
Comment thread packages/core/src/iam/adapters/admin-player-activity.ts
Comment thread packages/core/src/iam/adapters/admin-player-activity.ts
Comment thread packages/core/src/casino/gaming/admin-reporting.ts
…r-analytics

# Conflicts:
#	packages/core/src/casino/gaming/__tests__/gaming.service.test.ts
@marek-chmielowski-blurify
marek-chmielowski-blurify merged commit 5be1314 into dev Jul 28, 2026
2 checks passed
@marek-chmielowski-blurify
marek-chmielowski-blurify deleted the feat/bf-218-game-player-analytics branch July 28, 2026 13:51
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants