Skip to content

Development - #14

Merged
neoRandom merged 17 commits into
mainfrom
development
Aug 23, 2026
Merged

Development#14
neoRandom merged 17 commits into
mainfrom
development

Conversation

@neoRandom

Copy link
Copy Markdown
Owner

No description provided.

Interactions are game-specific; the query previously filtered only by player_id and returned a player's rows across all games. Now it filters by both game_id and player_id so the result is scoped to one game.
ListInteractions now accepts limit and offset so clients can paginate a game's interactions. The ListRecentInteractions SQL query becomes 'LIMIT ? OFFSET ?' with an Offset field added to ListRecentInteractionsParams. The use case validates offset >= 0.

To unbreak: update the remaining callers of port.DataFetching.ListInteractions to pass an offset argument - cliadapter.runFetch (cli.go), httpadapter.handleListInteractions (handlers.go), and the fakeFetch stub in httpadapter/http_test.go. Pass offset=0 for no pagination.
Fixes the breaking change in feat!(usecase): add offset to ListInteractions (fbcabe0).

The CLI (cliadapter.runFetch), HTTP handler (httpadapter.handleListInteractions), and the fakeFetch test stub now pass offset=0 so the codebase compiles and tests pass again.
The fetch interactions subcommand now accepts an optional third argument for the offset (defaulting to 0), so CLI users can paginate a game's interactions. Updates the CLI usage text and README to include the new <offset> argument, and adds CLI tests for default-offset, explicit-offset, invalid-offset, and too-many-arguments.
ListPlayerInteractions now accepts limit and offset so a caller can paginate a specific player's interactions within a game. The SQL query becomes 'LIMIT ? OFFSET ?' with Limit and Offset fields added to ListPlayerInteractionsParams, and the use case validates both are >= 0.

To unbreak: update the remaining callers of port.DataFetching.ListPlayerInteractions to pass limit and offset - the fakeFetch stub in httpadapter/http_test.go and the mockFetch stub in cliadapter/cli_test.go. Pass limit=~0~ with offset=0 to preserve existing behavior, or choose explicit values.
Fixes the breaking change in feat!(usecase): add limit and offset to ListPlayerInteractions (8a1f2cf).

The fakeFetch stub in httpadapter/http_test.go and the mockFetch stub in cliadapter/cli_test.go now use the 5-argument ListPlayerInteractions signature so the codebase compiles and all tests pass again.
The GET /interactions handler now accepts an optional query parameter with values all|player|first|last (default all), routing to the corresponding DataFetching use case, and an optional offset parameter for pagination. Invalid query or offset values return 400. Adds unit tests (routing + validation), a regression test proving no-param behavior equals query=all, and integration tests against real use cases and an in-memory SQLite database.
Adds the query parameter (enum all|player|first|last, default all with per-value descriptions), the offset parameter (minimum 0, default 0), and documents the 200 response shapes (array for all/player, single Interaction or null for first/last). Also documents the 400 response for invalid query or offset.
@neoRandom
neoRandom merged commit b4a44e7 into main Aug 23, 2026
1 check passed
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.

1 participant