d1ba666495
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
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).
100 lines
3.6 KiB
Go
100 lines
3.6 KiB
Go
//
|
|
// Code generated by go-jet DO NOT EDIT.
|
|
//
|
|
// WARNING: Changes to this file may cause incorrect behavior
|
|
// and will be lost if the code is regenerated
|
|
//
|
|
|
|
package table
|
|
|
|
import (
|
|
"github.com/go-jet/jet/v2/postgres"
|
|
)
|
|
|
|
var AccountSuspensions = newAccountSuspensionsTable("backend", "account_suspensions", "")
|
|
|
|
type accountSuspensionsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
SuspensionID postgres.ColumnString
|
|
AccountID postgres.ColumnString
|
|
BlockedAt postgres.ColumnTimestampz
|
|
BlockedUntil postgres.ColumnTimestampz
|
|
ReasonEn postgres.ColumnString
|
|
ReasonRu postgres.ColumnString
|
|
ReasonID postgres.ColumnString
|
|
LiftedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type AccountSuspensionsTable struct {
|
|
accountSuspensionsTable
|
|
|
|
EXCLUDED accountSuspensionsTable
|
|
}
|
|
|
|
// AS creates new AccountSuspensionsTable with assigned alias
|
|
func (a AccountSuspensionsTable) AS(alias string) *AccountSuspensionsTable {
|
|
return newAccountSuspensionsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new AccountSuspensionsTable with assigned schema name
|
|
func (a AccountSuspensionsTable) FromSchema(schemaName string) *AccountSuspensionsTable {
|
|
return newAccountSuspensionsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new AccountSuspensionsTable with assigned table prefix
|
|
func (a AccountSuspensionsTable) WithPrefix(prefix string) *AccountSuspensionsTable {
|
|
return newAccountSuspensionsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new AccountSuspensionsTable with assigned table suffix
|
|
func (a AccountSuspensionsTable) WithSuffix(suffix string) *AccountSuspensionsTable {
|
|
return newAccountSuspensionsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newAccountSuspensionsTable(schemaName, tableName, alias string) *AccountSuspensionsTable {
|
|
return &AccountSuspensionsTable{
|
|
accountSuspensionsTable: newAccountSuspensionsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newAccountSuspensionsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newAccountSuspensionsTableImpl(schemaName, tableName, alias string) accountSuspensionsTable {
|
|
var (
|
|
SuspensionIDColumn = postgres.StringColumn("suspension_id")
|
|
AccountIDColumn = postgres.StringColumn("account_id")
|
|
BlockedAtColumn = postgres.TimestampzColumn("blocked_at")
|
|
BlockedUntilColumn = postgres.TimestampzColumn("blocked_until")
|
|
ReasonEnColumn = postgres.StringColumn("reason_en")
|
|
ReasonRuColumn = postgres.StringColumn("reason_ru")
|
|
ReasonIDColumn = postgres.StringColumn("reason_id")
|
|
LiftedAtColumn = postgres.TimestampzColumn("lifted_at")
|
|
allColumns = postgres.ColumnList{SuspensionIDColumn, AccountIDColumn, BlockedAtColumn, BlockedUntilColumn, ReasonEnColumn, ReasonRuColumn, ReasonIDColumn, LiftedAtColumn}
|
|
mutableColumns = postgres.ColumnList{AccountIDColumn, BlockedAtColumn, BlockedUntilColumn, ReasonEnColumn, ReasonRuColumn, ReasonIDColumn, LiftedAtColumn}
|
|
defaultColumns = postgres.ColumnList{BlockedAtColumn}
|
|
)
|
|
|
|
return accountSuspensionsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
SuspensionID: SuspensionIDColumn,
|
|
AccountID: AccountIDColumn,
|
|
BlockedAt: BlockedAtColumn,
|
|
BlockedUntil: BlockedUntilColumn,
|
|
ReasonEn: ReasonEnColumn,
|
|
ReasonRu: ReasonRuColumn,
|
|
ReasonID: ReasonIDColumn,
|
|
LiftedAt: LiftedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|