import { query } from "../config/db.js";

export async function writeAudit({ actorId = null, action, entityType = null, entityId = null, metadata = null, ipAddress = null }) {
  await query(
    `INSERT INTO audit_log(actor_user_id, action, entity_type, entity_id, metadata, ip_address)
     VALUES ($1,$2,$3,$4,$5,$6)`,
    [actorId, action, entityType, entityId, metadata, ipAddress]
  );
}
