Repository navigation
Conversation
okapitula
marked this pull request as ready for review
October 21, 2026 10:45
okapitula
requested review from
jakubfilinger-b,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify,
mp-blurify and
zaxovaiko
as code owners
October 21, 2026 10:45
zaxovaiko
removed request for
jakubfilinger-b,
klaudia-blazyczek-blurify,
mp-blurify and
zaxovaiko
October 21, 2026 10:45
okapitula
added this pull request to stack #339
October 21, 2026 10:47
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 21, 2026 12:51
24b0a2f to
ce6c680
Compare
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 21, 2026 14:14
ce6c680 to
9e20e27
Compare
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 21, 2026 18:57
9e20e27 to
d77cd10
Compare
Collaborator
|
|
Collaborator
Author
|
@marek-chmielowski-blurify Added |
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 22, 2026 15:46
8510f17 to
0114ca4
Compare
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 25, 2026 12:18
0114ca4 to
a948bfd
Compare
A backoffice player profile needs a player's sportsbook totals without paging through every bet. GET /backoffice/sportsbook/players/{userId}/summary returns, per currency, bet count, stake and payout split into cash and promotion-paid, GGR and open exposure, under the sportsbook view grant.
With a date range a stake counts in the period its bet was accepted and a payout in the period it settled; cancelled bets count in neither. Open exposure is the stake on every accepted, unsettled bet now, whatever the range. GGR is cash stake minus payout, the wallet ledger's rule applied per bet, so a promotion-paid stake earns nothing and a promotion payout costs in full. Totals are summed in SQL from the bet rows as they stand now.
The restriction routes now share this route's player check.
…tus lookup flag Backoffice finding and bet pages lacked three reads. Finding amounts rendered without a currency, findings could not be narrowed to one player, and the bet page could not tell in advance that align would be refused for a provider with no bet status lookup. Each finding now carries its bet's currency, joined from the bet at read time so existing findings get it too; it is null for a finding with no bet, and a refused stake's detail now names its own currency. The findings list takes an optional userId filter, backed by a (user_id, created_at, id) index. The admin bet detail carries providerStatusLookup, true only when the bound provider is the bet's provider and has a status lookup, the same conditions align checks.
okapitula
force-pushed
the
feat/sportsbook-player-summary
branch
from
October 26, 2026 09:11
a948bfd to
8fe8f5c
Compare
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.
Stacked on #337. Review that PR first; this one retargets to
devonce it merges.Summary
Adds the backoffice reads a sportsbook player profile and its finding and bet pages need.
GET /backoffice/sportsbook/players/{userId}/summarygives per-currency totals for one player. Each reconciliation finding now carries its bet's currency, the findings list can be filtered byuserId, and the admin bet detail says whether align can look up the bet's status.Why
(user_id, accepted_at)and(user_id, status, settled_at)indexes onsportsbook_betserve each part of the filter, so a narrow range reads only that range's bets, not the player's whole history.detailnow names its own currency.userId, backed by a new(user_id, created_at, id)index.providerStatusLookupis true only when the bound provider is the bet's provider and has a status lookup, which are the same conditions align checks.Alternatives considered
Risks
CREATE INDEXstatements, each locking writes on its table while it builds.sportsbook_reconciliation_findingis cheap; that table holds only reconciliation findings.sportsbook_betblock bet placement and settlement for the build time. On a large bet table, run the migration in a quiet window.