This commit is contained in:
2026-10-03 13:33:18 +07:00
parent 2caa2c1a88
commit 5d8c296ecd
30 changed files with 94 additions and 94 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import (
var (
// ErrActionsNotFound indicates that no actions were found.
ErrActionsNotFound = errors.New("Ход не найден")
ErrActionsNotFound = errors.New("ход не найден")
)
// ActionsRepo persists team actions.
+1 -1
View File
@@ -11,7 +11,7 @@ import (
var (
// ErrApplicationNotFound indicates that an application was not found.
ErrApplicationNotFound = errors.New("Улика не найдена")
ErrApplicationNotFound = errors.New("улика не найдена")
)
// ApplicationsRepo persists team applications.
+4 -4
View File
@@ -12,13 +12,13 @@ import (
var (
// ErrReviewNotFound indicates that a review was not found.
ErrReviewNotFound = errors.New("Отзыв не найден")
ErrReviewNotFound = errors.New("отзыв не найден")
// ErrReviewExists indicates that a team already submitted a review.
ErrReviewExists = errors.New("Отзыв от команды уже оставлен")
ErrReviewExists = errors.New("отзыв от команды уже оставлен")
// ErrTeamNotFound indicates that a team was not found.
ErrTeamNotFound = errors.New("Команда не найдена")
ErrTeamNotFound = errors.New("команда не найдена")
// ErrInvalidStatus indicates that a moderation status is invalid.
ErrInvalidStatus = errors.New("Недопустимый статус модерации")
ErrInvalidStatus = errors.New("недопустимый статус модерации")
)
// Review describes a game review.
+1 -1
View File
@@ -13,7 +13,7 @@ import (
var (
// ErrGameNotFound indicates that a game was not found.
ErrGameNotFound = errors.New("Игра не найдена")
ErrGameNotFound = errors.New("игра не найдена")
)
// GamesRepo persists games.
+1 -1
View File
@@ -12,7 +12,7 @@ import (
var (
// ErrScenarioNotFound indicates that a scenario was not found.
ErrScenarioNotFound = errors.New("Сценарий не найден")
ErrScenarioNotFound = errors.New("сценарий не найден")
)
// ScenariosRepo persists scenarios.
+1 -1
View File
@@ -11,7 +11,7 @@ import (
)
// ErrScreenNotFound indicates that a screen session was not found.
var ErrScreenNotFound = errors.New("Экран не найден")
var ErrScreenNotFound = errors.New("экран не найден")
// ScreenSession describes a screen session.
type ScreenSession struct {
+4 -4
View File
@@ -12,13 +12,13 @@ import (
)
// ErrParticipationLink indicates that a participation link is invalid.
var ErrParticipationLink = errors.New("Ссылка недействительна")
var ErrParticipationLink = errors.New("ссылка недействительна")
// ErrParticipationClosed indicates that participation answers are closed.
var ErrParticipationClosed = errors.New("Приём ответов закрыт")
var ErrParticipationClosed = errors.New("приём ответов закрыт")
// ErrParticipationFinal indicates that a final answer cannot be changed.
var ErrParticipationFinal = errors.New("Решение уже принято и не может быть изменено")
var ErrParticipationFinal = errors.New("решение уже принято и не может быть изменено")
const maxParticipationEmailAttempts = 8
@@ -80,7 +80,7 @@ func (r *TeamsRepo) GetParticipation(ctx context.Context, token string) (*Partic
// AnswerParticipation stores a team's final answer.
func (r *TeamsRepo) AnswerParticipation(ctx context.Context, token, answer string) (*Participation, error) {
if answer != "confirmed" && answer != "cancelled" {
return nil, errors.New("Выберите подтверждение или отмену участия")
return nil, errors.New("выберите подтверждение или отмену участия")
}
hash, err := tokenHash(token)
if err != nil {
+2 -2
View File
@@ -11,7 +11,7 @@ import (
var (
// ErrTeamNotFound indicates that a team was not found.
ErrTeamNotFound = errors.New("Команда не найдена")
ErrTeamNotFound = errors.New("команда не найдена")
)
// TeamsRepo persists teams and their game membership.
@@ -189,7 +189,7 @@ func (r *TeamsRepo) DeleteTeam(ctx context.Context, teamID int) error {
}
// ErrRegistrationClosed indicates that team registration is unavailable.
var ErrRegistrationClosed = errors.New("Игра не найдена или регистрация уже закрыта")
var ErrRegistrationClosed = errors.New("игра не найдена или регистрация уже закрыта")
func (r *TeamsRepo) RegisterTeam(ctx context.Context, gameID int, deliveryID, name, email string, participantsCount int32, password string) (int, error) {
return r.RegisterTeamWithParticipation(ctx, gameID, deliveryID, name, email, participantsCount, password, false)
+3 -3
View File
@@ -11,11 +11,11 @@ import (
var (
// ErrTicketNotFound indicates that a ticket was not found.
ErrTicketNotFound = errors.New("Билет не найден")
ErrTicketNotFound = errors.New("билет не найден")
// ErrTicketUsed indicates that a ticket was already used.
ErrTicketUsed = errors.New("Билет уже использован")
ErrTicketUsed = errors.New("билет уже использован")
// ErrGameFinished indicates that the game has finished.
ErrGameFinished = errors.New("Игра уже завершена")
ErrGameFinished = errors.New("игра уже завершена")
)
// Info describes a support ticket.
+4 -4
View File
@@ -15,7 +15,7 @@ import (
var (
// ErrUserNotFound indicates that a user was not found.
ErrUserNotFound = errors.New("Пользователь не найден")
ErrUserNotFound = errors.New("пользователь не найден")
)
// UsersRepo persists users and their roles.
@@ -39,7 +39,7 @@ func (s *UsersRepo) AddUserWithAgreements(
agreements []user_agreements_repo.Agreement,
) (int, error) {
if len(agreements) == 0 {
return 0, errors.New("Не переданы записи об акцепте соглашений")
return 0, errors.New("не переданы записи об акцепте соглашений")
}
tx, err := s.pool.Begin(ctx)
@@ -68,11 +68,11 @@ func (s *UsersRepo) AddUserWithAgreements(
).Scan(&id)
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return 0, errors.New("Username или email уже используется")
return 0, errors.New("username или email уже используется")
}
var pgErr *pgconn.PgError
if errors.As(err, &pgErr) && pgErr.Code == "23505" {
return 0, errors.New("Username или email уже используется")
return 0, errors.New("username или email уже используется")
}
return 0, err
}