feat(gaming): read-only game catalog port for plugins - #174
Merged
Merged
Conversation
okapitula
requested review from
damianrzepka,
jakubfilinger-b,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify,
mp-blurify and
zaxovaiko
as code owners
September 15, 2026 13:12
zaxovaiko
reviewed
Sep 15, 2026
Adds GAME_CATALOG_READER, owned and bound by the gaming module, so plugins outside casino/gaming can read playable games, active categories and active providers without importing the gaming tables or re-implementing the playability rule (game and provider both active).
okapitula
force-pushed
the
feat/add-game-catalog-reader
branch
from
September 15, 2026 18:35
b079e00 to
963b5cb
Compare
marek-chmielowski-blurify
approved these changes
Sep 17, 2026
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
Adds
GAME_CATALOG_READER, a read-only port owned and registered by the gaming module. Plugins outsidecasino/gamingcan use it to read playable games, active categories and active providers without importing the gaming tables.Why
Overlay lobby sections (
defineLobbySection) need games, categories and providers. Until now the only way to get them was to import@openora/core/casino/schema/gamingand write their own Drizzle queries. That copied the playability rule into consumer code. One overlay checked onlygame.isActive, so games from a disabled provider still showed in its lobby sections. Each of those schema reads also blocks extracting gaming into its own service (ADR-0017).The port applies core's own
playableGameCondition()(game and provider both active), so consumers can't drift from core's visibility rule. It returns plain objects typed from thegame.tscontract schemas, and every method answers a whole list of ids in one query:getPlayableGames(ids),getActiveCategories(ids, { withGameCount? }),getActiveProviders(ids)andgetCategoryIdsByGame(ids)return aMapin the order the ids were passed. Unknown, inactive, unplayable or malformed ids are left out rather than throwing.listPlayableGamesInCategory(id, { limit }),listActiveCategoriesWithGameCount()andlistActiveProviders()return ordered lists.gameCountcounts playable games only.The gaming services now share their provider and category column sets and the
countWherehelper throughcasino/shared/game-catalog.ts. The selected columns haven't changed.Alternatives considered
GamingService,GameProviderServiceandGameCategoryService: module-structure rules forbid importing another module's service, and those services also carry audited admin writes. Their reads are paged or fetch a single row, so a lobby section would end up doing one query per game.playableGameCondition()on a public subpath: consumers would still query gaming's tables directly, which keeps the extraction blocker and the duplicated queries.Risks
None.