const { PrismaClient } = require("@prisma/client")
const prisma = new PrismaClient()

async function findSeller(where, options = {}) {
  return prisma.seller.findFirst({
    where,
    include: options.include || undefined,
    select: options.select || undefined,
  })
}

async function findSellerByDomain(domain) {
  return prisma.seller.findFirst({
    where: {
      domains: {
        some: {
          domain: domain,
        },
      },
    },
  })
}


module.exports = {
  findSeller,
  findSellerByDomain,
}
