Addressing PR comments - #781
Conversation
| suspend fun listLastGames( | ||
| limit: Int, | ||
| statusToExcludes: List<GameEventType> = listOf(), | ||
| variantToInclude: Variant? = null, |
There was a problem hiding this comment.
@copilot should be a list that by default include all variants.
There was a problem hiding this comment.
Updated in f07c340: listLastGames now takes variantsToInclude: List<Variant> = Variant.entries, so it defaults to all variants and supports subset filters (Manchu feed now passes listOf(Variant.MANCHU)).
There was a problem hiding this comment.
Done in 0fe1408: I dropped AdminFeedServiceTest.
| </tbody> | ||
| </table> | ||
|
|
||
| <h1>Last Manchu Game Updates</h1> |
| get("/list-games") { | ||
| requireAdminRole { adminFeedService.listLastGames() } | ||
| } | ||
| get("/list-manchu-games") { |
There was a problem hiding this comment.
@copilot Generalize this to "variants" (i.e. non-xiangqi variants)
There was a problem hiding this comment.
Done in 30c629f. I generalized the dedicated endpoints and feed logic to variants (non-Xiangqi): /list-variant-games and /list-variant-bot-games, backed by a shared non-Xiangqi variant filter instead of Manchu-only naming.
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/3e39c3d6-ad24-48f9-b67f-f09b50fe53f2 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5b41f284-7e4c-44c3-aff1-e657cdbc5b05 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/d9f48969-b3af-4bdf-9302-4e6e68dc2671 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
There was a problem hiding this comment.
@claude[agent] In fetchGameMetadata, is there a way to re-use the mappers that are defined at the bottom of the file?
There was a problem hiding this comment.
The mappers at the bottom (mapPlayerVsBotGameToDto, mapPlayerVsPlayerGameToDto) are designed for list views and populate fields like redPlayerRating, redUserType, isRedOnline, etc., while fetchGameMetadata is for individual game detail and populates analysisStatus, engine, depth, startFen — fields the list mappers don't set.
The mappers also require a pre-computed onlineUserIds: Set<String> (batched from multiple records), which doesn't apply to a single-game lookup.
For the DB case there's no corresponding mapper at all — that logic lives only in fetchGameMetadata.
So no, they can't be reused as-is without restructuring those mappers. Let me know if you'd like me to refactor them to make reuse possible (e.g. make onlineUserIds optional, add the missing fields).
There was a problem hiding this comment.
@claude[agent] I merged this PR. Do this in another PR. Just fill everything that can be filled each time.
No description provided.