diff --git a/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx b/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx index 0107ee5ac..1b434b339 100644 --- a/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx +++ b/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx @@ -72,7 +72,9 @@ export default function TournamentAdminRegistrationPage() { ownerId: owner ? String(owner.userId) : "", members: team.members.map((member) => ({ userId: member.userId, - inGameName: member.inGameName ?? null, + inGameName: tournament.ctx.settings.requireInGameNames + ? (member.inGameName ?? null) + : null, })), } : undefined; diff --git a/app/features/tournament-admin/tournament-admin-registration-schemas.server.ts b/app/features/tournament-admin/tournament-admin-registration-schemas.server.ts index c3a03badb..d7247eb98 100644 --- a/app/features/tournament-admin/tournament-admin-registration-schemas.server.ts +++ b/app/features/tournament-admin/tournament-admin-registration-schemas.server.ts @@ -4,7 +4,10 @@ import * as TeamRepository from "~/features/team/TeamRepository.server"; import { tournamentTeamNameTaken } from "~/features/tournament/tournament-utils.server"; import type { Tournament } from "~/features/tournament-bracket/core/Tournament"; import * as UserRepository from "~/features/user-page/UserRepository.server"; -import { adminRegistrationFormSchema } from "./tournament-admin-registration-schemas"; +import { + ADMIN_REGISTRATION_MAX_MEMBERS, + adminRegistrationFormSchema, +} from "./tournament-admin-registration-schemas"; /** * Extends the client {@link adminRegistrationFormSchema} with server-only, @@ -38,7 +41,7 @@ export function adminRegistrationFormSchemaServer({ }); } - if (data.members.length > tournament.maxMembersPerTeam) { + if (data.members.length > ADMIN_REGISTRATION_MAX_MEMBERS) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: "forms:errors.regTooManyMembers", diff --git a/app/features/tournament-admin/tournament-admin-registration-schemas.ts b/app/features/tournament-admin/tournament-admin-registration-schemas.ts index f30f0d80e..4d9c76fe3 100644 --- a/app/features/tournament-admin/tournament-admin-registration-schemas.ts +++ b/app/features/tournament-admin/tournament-admin-registration-schemas.ts @@ -14,7 +14,12 @@ import { tournamentSearchOptional, userSearch, } from "~/form/fields"; -import { TEAM } from "../team/team-constants"; +/** + * Roster size cap for organizer-managed registrations. The per-tournament + * `maxMembersPerTeam` limit intentionally doesn't apply to organizers, so this + * is just a generous safety ceiling rather than a competitive constraint. + */ +export const ADMIN_REGISTRATION_MAX_MEMBERS = 20; const memberFieldset = fieldset({ fields: z.object({ @@ -44,7 +49,7 @@ export const adminRegistrationFormSchema = z members: array({ label: "labels.members", min: 1, - max: TEAM.MAX_MEMBER_COUNT, + max: ADMIN_REGISTRATION_MAX_MEMBERS, field: memberFieldset, }), })