/**
 * Email Templates Domain Adapter
 *
 * Routes email_templates CRUD to Prisma. Prisma passthrough for now;
 * Convex path will be added when mutations are available.
 */

import { prisma } from "@/lib/db";

export const emailTemplatesAdapter = {
  async findMany(args: {
    where?: Record<string, unknown>;
    orderBy?: Record<string, unknown>;
  }) {
    return prisma.email_templates.findMany(args as never);
  },

  async findUnique(args: {
    where: Record<string, unknown>;
    select?: Record<string, boolean>;
  }) {
    return prisma.email_templates.findUnique(args as never);
  },

  async create(args: { data: Record<string, unknown> }) {
    return prisma.email_templates.create(args as never);
  },

  async update(args: {
    where: Record<string, unknown>;
    data: Record<string, unknown>;
  }) {
    return prisma.email_templates.update(args as never);
  },

  async delete(args: { where: Record<string, unknown> }) {
    return prisma.email_templates.delete(args as never);
  },
};
