Phase 28 (Step 2): FBS schemas + message-type constants for mail
Tests · UI / test (push) Has been cancelled
Tests · Go / test (pull_request) Successful in 2m4s
Tests · Go / test (push) Successful in 2m5s
Tests · Integration / integration (pull_request) Successful in 1m54s
Tests · UI / test (pull_request) Successful in 2m50s

Adds the wire schema for the eight `user.games.mail.*` ConnectRPC
commands together with the shared payload types (`MailMessage`,
`MailRecipientState`, `MailBroadcastReceipt`). Send-request tables
carry the optional `recipient_race_name` introduced in Step 1.

Drops:

- `pkg/schema/fbs/diplomail.fbs` — schema sources;
- `pkg/schema/fbs/diplomail/*.go` — generated Go bindings (flatc
  `--go --go-module-name galaxy/schema/fbs`);
- `pkg/model/diplomail/diplomail.go` — message-type catalog used by
  the gateway router;
- `ui/frontend/src/proto/galaxy/fbs/diplomail/*.ts` — generated TS
  bindings consumed by the upcoming UI client wrapper;
- `ui/Makefile` `FBS_INPUTS` extended to pick the new schema up on
  the next `make -C ui fbs-ts` run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-15 22:21:23 +02:00
parent 7b43ce5844
commit fed282f2d2
42 changed files with 4399 additions and 1 deletions
+56
View File
@@ -0,0 +1,56 @@
// Package diplomail defines the public typed command identifiers
// exposed at the authenticated Gateway -> Diplomatic Mail boundary.
//
// The gateway routes each `user.games.mail.*` ExecuteCommand into the
// matching `/api/v1/user/games/{game_id}/mail/*` REST endpoint on the
// backend; the wire envelopes and payload tables live in
// `pkg/schema/fbs/diplomail.fbs`.
package diplomail
const (
// MessageTypeUserGamesMailInbox is the authenticated gateway
// message type used to read the caller's diplomatic-mail inbox
// for one game. Backend filters out rows whose `available_at` is
// still nil (translation in flight).
MessageTypeUserGamesMailInbox = "user.games.mail.inbox"
// MessageTypeUserGamesMailSent is the authenticated gateway
// message type used to read the caller's outgoing personal
// messages for one game. Admin and system rows are not included.
MessageTypeUserGamesMailSent = "user.games.mail.sent"
// MessageTypeUserGamesMailMessageGet is the authenticated
// gateway message type used to read a single message detail
// addressed to the caller. The response carries the translation
// rendering when one is cached for the caller's preferred
// language.
MessageTypeUserGamesMailMessageGet = "user.games.mail.message.get"
// MessageTypeUserGamesMailSend is the authenticated gateway
// message type used to send a single-recipient personal message.
// Exactly one of `recipient_user_id` and `recipient_race_name`
// must be supplied; the backend resolves the race-name shortcut
// through `Memberships.ListMembers(gameID, "active")`.
MessageTypeUserGamesMailSend = "user.games.mail.send"
// MessageTypeUserGamesMailBroadcast is the authenticated gateway
// message type used by paid-tier callers to broadcast a personal
// message to every other active member of the game.
MessageTypeUserGamesMailBroadcast = "user.games.mail.broadcast"
// MessageTypeUserGamesMailAdmin is the authenticated gateway
// message type used by the game owner to compose an admin-kind
// notification. The wire shape is target-discriminated: `user`
// addresses a single recipient (by id or race name); `all`
// broadcasts to every member matching the requested scope.
MessageTypeUserGamesMailAdmin = "user.games.mail.admin"
// MessageTypeUserGamesMailRead is the authenticated gateway
// message type used to mark a single message as read. Idempotent.
MessageTypeUserGamesMailRead = "user.games.mail.read"
// MessageTypeUserGamesMailDelete is the authenticated gateway
// message type used to soft-delete a single message. The
// recipient row must already be marked read.
MessageTypeUserGamesMailDelete = "user.games.mail.delete"
)