import { prisma } from "../../db/prisma.js";

export const moderationService = {
  async warnUser(input: {
    guildId: string;
    userId: string;
    moderatorId: string;
    reason: string;
  }) {
    return prisma.warning.create({ data: input });
  },

  async getWarnings(guildId: string, userId: string) {
    return prisma.warning.findMany({
      where: { guildId, userId },
      orderBy: { createdAt: "desc" },
      take: 10,
    });
  },
};
