The headache
Ad-hoc SQL, stringified payloads, and secrets that land in the log because nobody owns the write path.
await db.query(
`INSERT INTO audit_logs (event, actor_id, payload)
VALUES ($1, $2, $3)`,
[
"invoice.sent",
req.user.id,
JSON.stringify({
...req.body,
card: req.body.card,
token: req.body.token,
}),
],
);