import { prisma } from "@/lib/prisma";

export const projectRepository = {
  getAll: () =>
    prisma.project.findMany({
      orderBy: {
        createdAt: "desc",
      },
    }),

  getById: (id: string) =>
    prisma.project.findUnique({
      where: { id },
    }),

  create: (data: any) =>
    prisma.project.create({
      data,
    }),

  update: (id: string, data: any) =>
    prisma.project.update({
      where: { id },
      data,
    }),

  delete: (id: string) =>
    prisma.project.delete({
      where: { id },
    }),
};