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

async function logAudit({
  actorId,
  targetId,
  action,
  details = null,
}) {
  if (!actorId || !targetId || !action) return;

  return prisma.auditLog.create({
    data: { actorId, targetId, action, details },
  });
}

module.exports = { logAudit };
