diff --git a/app/features/tournament/queries/findTeamsByTournamentId.server.ts b/app/features/tournament/queries/findTeamsByTournamentId.server.ts
index b3118cd18..d60a4ce47 100644
--- a/app/features/tournament/queries/findTeamsByTournamentId.server.ts
+++ b/app/features/tournament/queries/findTeamsByTournamentId.server.ts
@@ -15,6 +15,7 @@ const stm = sql.prepare(/*sql*/ `
"TournamentTeam"."id",
"TournamentTeam"."name",
"TournamentTeam"."seed",
+ "TournamentTeam"."createdAt",
"TournamentTeamCheckIn"."checkedInAt",
"TournamentTeam"."prefersNotToHost",
json_group_array(
@@ -53,6 +54,7 @@ export interface FindTeamsByTournamentIdItem {
id: TournamentTeam["id"];
name: TournamentTeam["name"];
seed: TournamentTeam["seed"];
+ createdAt: TournamentTeam["createdAt"];
checkedInAt: TournamentTeamCheckIn["checkedInAt"] | null;
prefersNotToHost: TournamentTeam["prefersNotToHost"];
members: Array<
diff --git a/app/features/tournament/routes/to.$id.admin.tsx b/app/features/tournament/routes/to.$id.admin.tsx
index 1eb2e23d0..fade4b0dc 100644
--- a/app/features/tournament/routes/to.$id.admin.tsx
+++ b/app/features/tournament/routes/to.$id.admin.tsx
@@ -47,6 +47,7 @@ import { Avatar } from "~/components/Avatar";
import { TrashIcon } from "~/components/icons/Trash";
import { FormMessage } from "~/components/FormMessage";
import { Label } from "~/components/Label";
+import { databaseTimestampToDate } from "~/utils/dates";
export const action: ActionFunction = async ({ request, params }) => {
const user = await requireUserId(request);
@@ -630,6 +631,28 @@ function DownloadParticipants() {
.join("\n");
}
+ function checkedInParticipantsContent() {
+ const header = "Teams ordered by registration time\n---\n";
+
+ return (
+ header +
+ data.teams
+ .slice()
+ .sort((a, b) => a.createdAt - b.createdAt)
+ .filter((team) => team.checkedInAt)
+ .map((team, i) => {
+ return `${i + 1}) ${team.name} - ${databaseTimestampToDate(
+ team.createdAt,
+ ).toISOString()} - ${team.members
+ .map(
+ (member) => `${discordFullName(member)} - <@${member.discordId}>`,
+ )
+ .join(" / ")}`;
+ })
+ .join("\n")
+ );
+ }
+
function notCheckedInParticipantsContent() {
return data.teams
.slice()
@@ -668,6 +691,17 @@ function DownloadParticipants() {
>
All participants
+