R6(a): de-stage code, docs, READMEs; split stage6_test
Mechanical, behaviour-preserving removal of Stage N / TODO-N / phase (RN) references from comments, doc-comments, service READMEs, the current-state docs (ARCHITECTURE, FUNCTIONAL+_ru, TESTING, UI_DESIGN), config-file comments, and the .fbs/.proto schema comments. PLAN.md / PRERELEASE.md / CLAUDE.md keep the stage history. - Rename the only stage-named identifiers: registerStage8 -> registerSocialOps, registerStage11 -> registerLinkOps (gateway transcode). - Split stage6_test.go: TestEmailLoginFlow -> email_test.go, TestGuestAutoMatchLeavesNoStats (+ provisionGuest) -> account_test.go. - Regenerated proto bindings (push.pb.go, telegram_grpc.pb.go) from the de-staged .proto comments; FB Go/TS bindings unchanged (flatc strips schema comments). go build/vet/gofmt clean across modules; integration typecheck and pnpm check green.
This commit is contained in:
@@ -12,10 +12,9 @@ import (
|
||||
"scrabble/backend/internal/game"
|
||||
)
|
||||
|
||||
// The handlers below extend the Stage 6 vertical slice with the remaining game and
|
||||
// chat operations the UI needs (PLAN.md Stage 7). They follow the same pattern as
|
||||
// handlers_user.go: X-User-ID identity, the domain service call, a JSON DTO mapped
|
||||
// from the result.
|
||||
// The handlers below cover the game and chat operations the UI needs. They follow
|
||||
// the same pattern as handlers_user.go: X-User-ID identity, the domain service
|
||||
// call, a JSON DTO mapped from the result.
|
||||
|
||||
// hintResultDTO is the top-ranked move plus the remaining hint budget.
|
||||
type hintResultDTO struct {
|
||||
@@ -53,7 +52,7 @@ type chatListDTO struct {
|
||||
}
|
||||
|
||||
// exchangeRequest swaps the given rack tiles back into the bag. Tiles are wire alphabet
|
||||
// indices (Stage 13); a blank is engine.BlankIndex.
|
||||
// indices; a blank is engine.BlankIndex.
|
||||
type exchangeRequest struct {
|
||||
Tiles []int `json:"tiles"`
|
||||
}
|
||||
@@ -211,7 +210,7 @@ func (s *Server) handleEvaluate(c *gin.Context) {
|
||||
}
|
||||
|
||||
// handleCheckWord looks a word up in the game's pinned dictionary. The word arrives as
|
||||
// repeated ?idx= alphabet indices (Stage 13); the backend decodes them to the concrete
|
||||
// repeated ?idx= alphabet indices; the backend decodes them to the concrete
|
||||
// word for the lookup and echoes that concrete word back for the client's result cache.
|
||||
func (s *Server) handleCheckWord(c *gin.Context) {
|
||||
_, gameID, ok := s.userGame(c)
|
||||
@@ -242,7 +241,7 @@ func (s *Server) handleCheckWord(c *gin.Context) {
|
||||
}
|
||||
|
||||
// queryIndexes parses repeated integer query parameters (e.g. ?idx=2&idx=0) into a slice.
|
||||
// It carries a word-check query as alphabet indices on a GET (Stage 13).
|
||||
// It carries a word-check query as alphabet indices on a GET.
|
||||
func queryIndexes(c *gin.Context, key string) ([]int, error) {
|
||||
raw := c.QueryArray(key)
|
||||
out := make([]int, 0, len(raw))
|
||||
@@ -326,7 +325,7 @@ type draftTileDTO struct {
|
||||
Blank bool `json:"blank"`
|
||||
}
|
||||
|
||||
// draftDTO is a player's persisted client-side composition for a game (Stage 17): the
|
||||
// draftDTO is a player's persisted client-side composition for a game: the
|
||||
// preferred rack tile order (an opaque client string) and the board tiles laid but not yet
|
||||
// submitted. The gateway forwards the JSON verbatim; this layer owns its shape.
|
||||
type draftDTO struct {
|
||||
@@ -352,7 +351,7 @@ func (d draftDTO) toDomain() game.Draft {
|
||||
return game.Draft{RackOrder: d.RackOrder, BoardTiles: tiles}
|
||||
}
|
||||
|
||||
// handleGetDraft returns the player's saved composition for a game (Stage 17), or an empty
|
||||
// handleGetDraft returns the player's saved composition for a game, or an empty
|
||||
// draft when none is stored.
|
||||
func (s *Server) handleGetDraft(c *gin.Context) {
|
||||
uid, gameID, ok := s.userGame(c)
|
||||
@@ -367,7 +366,7 @@ func (s *Server) handleGetDraft(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, draftDTOFrom(d))
|
||||
}
|
||||
|
||||
// handleSaveDraft upserts the player's composition for a game (Stage 17). The service
|
||||
// handleSaveDraft upserts the player's composition for a game. The service
|
||||
// rejects a non-player with ErrNotAPlayer.
|
||||
func (s *Server) handleSaveDraft(c *gin.Context) {
|
||||
uid, gameID, ok := s.userGame(c)
|
||||
|
||||
Reference in New Issue
Block a user