feat(enakgame): filter play history by game and status

GET /customer/enakgame/sessions takes optional game_id and status, so a game
reloaded mid-play finds the session it was running (status=STARTED) instead
of starting a new one and charging EnakCoin again. An invalid game_id or
status is refused.

integration-enakgame.md §4.4 now describes recovery after a reload: keep the
session_id in sessionStorage, continue a STARTED session before expires_at,
and call complete again for a COMPLETED one to get the full answer, prize
included. The mobile guide and RFC §11 mention the filters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
efrilm
2026-10-08 12:51:39 +07:00
co-authored by Claude Opus 5.5
parent b5d2cd491a
commit 52e8fe11c6
10 changed files with 129 additions and 24 deletions
+10
View File
@@ -189,6 +189,16 @@ type CustomerGameSession struct {
RefundReason *string `json:"refund_reason"`
}
// GameSessionListQuery filters a customer's play history. The game client uses
// game_id with status=STARTED to find the play it was running before a reload.
type GameSessionListQuery struct {
GameID string `form:"game_id"`
// STARTED, COMPLETED, REFUNDED or EXPIRED; empty for all.
Status string `form:"status"`
Page int `form:"page"`
Limit int `form:"limit"`
}
// GameSessionCompleteInput is what the client reports at the end of a play (§7.2): data
// only. Anything else it sends, a reward amount above all, is ignored (P1).
type GameSessionCompleteInput struct {