
const prisma = require("./client");

async function findUserByEmail(email, options = {}) {
  return prisma.user.findUnique({
    where: { email },
    include: options.include || undefined,
    select: options.select || undefined,
  });
}
async function createUser(data) {
  return prisma.user.create({ data });
}

async function findUserById(id, options = {}) {
  return prisma.user.findUnique({
    where: { id },
    select: options.select || undefined,
    include: options.include || undefined,
  });
}

module.exports = {
  findUserByEmail,
  createUser,
  findUserById,
};