import { Prisma, Report } from '@prisma/client'; import prisma from 'lib/prisma'; export async function createReport(data: Prisma.ReportUncheckedCreateInput): Promise { return prisma.client.report.create({ data }); } export async function getReportById(reportId: string): Promise { return prisma.client.report.findUnique({ where: { id: reportId, }, }); } export async function getReports(where: Prisma.ReportWhereInput): Promise { return prisma.client.report.findMany({ where, }); } export async function updateReport( data: Prisma.ReportUpdateInput, where: Prisma.ReportWhereUniqueInput, ): Promise { return prisma.client.report.update({ data, where }); } export async function deleteReport(where: Prisma.ReportWhereUniqueInput): Promise { return prisma.client.report.delete({ where }); }