import type { PrismaClient } from '@prisma/client';

export async function ensureGuild(prisma: PrismaClient, guildId: string): Promise<void> {
  await prisma.guild.upsert({
    where: { id: guildId },
    update: {},
    create: { id: guildId }
  });
}

export async function ensureGuildSettings(
  prisma: PrismaClient,
  guildId: string
): Promise<void> {
  await ensureGuild(prisma, guildId);
  await prisma.guildSettings.upsert({
    where: { guildId },
    update: {},
    create: { guildId }
  });
}
