feat(admin): ручная блокировка пользователей в админке #61

Merged
developer merged 2 commits from feature/admin-user-blocking into development 2026-06-14 20:28:12 +00:00
Owner

Ручная блокировка аккаунтов оператором — жёсткий аналог мягкого high-rate флага.

  • Постоянная или временная (1 день / 3 дня / 1 неделя / 1 месяц / произвольная дата в UTC).
  • Опциональная причина из редактируемого списка en+ru (страница Reasons); пользователю показывается на его языке, на блокировке хранится снимком.
  • Блокировка засчитывает поражение во всех активных партиях (как сдача) и отменяет открытые партии в матчмейкинге.
  • Гейт на бэкенде отвечает 403 account_blocked на любой /api/v1/user/* (кроме block-status); UI показывает терминальный экран блокировки и прекращает любой push/poll.
  • Временная блокировка истекает сама; разблокировка — кнопкой в карточке пользователя (проигранные партии не возвращаются).
  • Сессии не отзываются — заблокированный клиент должен достучаться до block-status.

Миграция 00003; fbs BlockStatus + операция account.block_status. Доки: ARCHITECTURE, FUNCTIONAL (+ru), PRERELEASE (строка AB). Полный локальный CI зелёный (unit + integration + UI check/unit/build/e2e).

Ручная блокировка аккаунтов оператором — жёсткий аналог мягкого high-rate флага. - Постоянная или временная (1 день / 3 дня / 1 неделя / 1 месяц / произвольная дата в UTC). - Опциональная причина из редактируемого списка en+ru (страница **Reasons**); пользователю показывается на его языке, на блокировке хранится снимком. - Блокировка засчитывает поражение во всех активных партиях (как сдача) и отменяет открытые партии в матчмейкинге. - Гейт на бэкенде отвечает **403 `account_blocked`** на любой `/api/v1/user/*` (кроме block-status); UI показывает терминальный экран блокировки и прекращает любой push/poll. - Временная блокировка истекает сама; разблокировка — кнопкой в карточке пользователя (проигранные партии не возвращаются). - Сессии не отзываются — заблокированный клиент должен достучаться до block-status. Миграция `00003`; fbs `BlockStatus` + операция `account.block_status`. Доки: ARCHITECTURE, FUNCTIONAL (+ru), PRERELEASE (строка **AB**). Полный локальный CI зелёный (unit + integration + UI check/unit/build/e2e).
developer added 1 commit 2026-06-14 19:56:31 +00:00
feat(admin): manual account blocking (suspensions)
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 12s
CI / ui (pull_request) Successful in 45s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m10s
d1ba666495
Operator-driven hard block, the counterpart to the soft high-rate flag: permanent or until a date, with an optional reason chosen from an editable en+ru picklist (snapshotted onto the block). A block forfeits the player's active games (opponent wins, as a resignation) and cancels their open matchmaking games. A backend gate refuses a blocked account on every /api/v1/user/* route except the block-status probe with 403 account_blocked, which threads through the gateway as the Execute result_code; the UI surfaces it as a terminal blocked screen and stops all push/poll. Temporary blocks self-expire; the operator can unblock at any time (lost games stay lost). Sessions are not revoked, so the blocked client can still reach the exempt block-status endpoint.

Backend: migration 00003 (account_suspensions + suspension_reasons) + jet regen; account suspension store; game.ForfeitAllForAccount; requireNotSuspended gate + block-status endpoint; admin console block/unblock + Reasons CRUD. Wire: fbs BlockStatus + account.block_status gateway op. UI: blocked screen, app state, transport/codec, i18n. Docs: ARCHITECTURE, FUNCTIONAL(+ru), PRERELEASE (AB).
owner approved these changes 2026-06-14 20:20:03 +00:00
Dismissed
developer added 1 commit 2026-06-14 20:24:58 +00:00
perf(admin): cache the suspension gate lookup
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 46s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m4s
290874720f
The suspension gate runs CurrentSuspension on every authenticated request. Add a write-through in-memory cache on account.Store keyed by account id, invalidated on Suspend/LiftSuspension, with the cached entry re-evaluated against the wall clock so a temporary block lapses without an explicit invalidation. Single-instance, matching the deployment (one shared Store). Keeps the gate off the database on the hot path while a block still takes effect on the next request.
developer dismissed owner's review 2026-06-14 20:24:58 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

owner approved these changes 2026-06-14 20:26:51 +00:00
developer merged commit a80952a835 into development 2026-06-14 20:28:12 +00:00
developer deleted branch feature/admin-user-blocking 2026-06-14 20:28:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#61