From a47b3024cc3ff99b66ef1acbe0ef01bb043441b6 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:47:11 +0300 Subject: [PATCH] SQ match seed --- app/db/seed/index.ts | 19 +++++++++++++++++-- app/features/api-private/constants.ts | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/db/seed/index.ts b/app/db/seed/index.ts index e5eb26ad5..d924bd86f 100644 --- a/app/db/seed/index.ts +++ b/app/db/seed/index.ts @@ -230,7 +230,7 @@ const basicSeeds = (variation?: SeedVariation | null) => [ arts, commissionsOpen, playedMatches, - variation === "NO_SQ_GROUPS" ? undefined : groups, + variation === "NO_SQ_GROUPS" ? undefined : () => groups(variation), friendCodes, lfgPosts, variation === "NO_SCRIMS" ? undefined : scrimPosts, @@ -2456,12 +2456,15 @@ function commissionsOpen() { } const SENDOU_IN_FULL_GROUP = true; -async function groups() { +async function groups(variation?: SeedVariation | null) { const users = userIdsInAscendingOrderById() .slice(0, 100) .filter((id) => id !== ADMIN_ID && id !== NZAP_TEST_ID); users.push(NZAP_TEST_ID); + let nzapGroupId = 0; + let sendouGroupId = 0; + for (let i = 0; i < 25; i++) { const group = await SQGroupRepository.createGroup({ status: "ACTIVE", @@ -2492,10 +2495,22 @@ async function groups() { }); } + if (i === 0) nzapGroupId = group.id; + if (i === 1) sendouGroupId = group.id; + if (i === 0 && SENDOU_IN_FULL_GROUP) { users.push(ADMIN_ID); } } + + if (variation === "IN_SQ_MATCH") { + await SQMatchRepository.create({ + alphaGroupId: sendouGroupId, + bravoGroupId: nzapGroupId, + mapList: randomMapList(sendouGroupId, nzapGroupId), + memento: { users: {}, groups: {}, pools: [] }, + }); + } } const randomMapList = ( diff --git a/app/features/api-private/constants.ts b/app/features/api-private/constants.ts index 6f6982bba..06736c669 100644 --- a/app/features/api-private/constants.ts +++ b/app/features/api-private/constants.ts @@ -7,4 +7,5 @@ export const SEED_VARIATIONS = [ "NO_SCRIMS", "NO_SQ_GROUPS", "FINALIZED_BRACKET", + "IN_SQ_MATCH", ] as const;