diff --git a/app/validators/seedVariations.ts b/app/validators/seedVariations.ts index 0e01bbbbb..ebee5881f 100644 --- a/app/validators/seedVariations.ts +++ b/app/validators/seedVariations.ts @@ -1,4 +1,8 @@ import { z } from "zod"; export type SeedVariations = z.infer; -export const SeedVariationsSchema = z.enum(["check-in", "match"]); +export const SeedVariationsSchema = z.enum([ + "check-in", + "match", + "tournament-start", +]); diff --git a/prisma/seed/script.ts b/prisma/seed/script.ts index c90ba3007..eee51317a 100644 --- a/prisma/seed/script.ts +++ b/prisma/seed/script.ts @@ -61,8 +61,10 @@ export async function seed(variation?: SeedVariations) { await trustRelationship(nzapUserCreated.id, adminUserCreated.id); await stages(); await tournamentAddMaps(tournament.id); - if (variation === "match") { + if (variation === "match" || variation === "tournament-start") { await tournamentRoundsCreate(); + } + if (variation === "match") { await advanceRound(); } @@ -149,14 +151,21 @@ export async function seed(variation?: SeedVariations) { "Woomy Zoomy Boomy", ]; - if (variation === "check-in" || variation === "match") { + if ( + variation === "check-in" || + variation === "match" || + variation === "tournament-start" + ) { const team = await prisma.tournamentTeam.create({ data: { name: "Kraken Paradise", tournamentId, friendCode: "1234-1234-1234", inviteCode: "033e3695-0421-4aa1-a5ef-6ee82297a398", - checkedInTime: variation === "match" ? new Date() : undefined, + checkedInTime: + variation === "match" || variation === "tournament-start" + ? new Date() + : undefined, }, });