This commit is contained in:
2026-10-11 13:47:22 +07:00
parent 6f2b63511c
commit 63f570aad1
17 changed files with 2038 additions and 247 deletions
+15
View File
@@ -166,3 +166,18 @@ func (s *TeamService) DownloadTeamQR(ctx context.Context, id int) ([]byte, strin
data, err := team_qr_pdf.Generate(cards)
return data, filename, err
}
// CheckPresence validates team credentials without loading game progress or a scenario.
func (s *TeamService) CheckPresence(ctx context.Context, teamID int, password string) (int, error) {
team, err := s.teamsRepo.GetTeamByID(ctx, teamID)
if errors.Is(err, teams_repo.ErrTeamNotFound) {
return 0, ErrTeamNotFound
}
if err != nil {
return 0, err
}
if team.Password != password || team.ParticipationStatus == "cancelled" {
return 0, ErrTeamNotFound
}
return team.GameID, nil
}