Files
KomediruzeckiandGitHub 97834e7e71 fix(backend): prod CSP, per-user profile uniqueness, N+1 tag query (#236)
- index.js: drop CSP `script-src 'unsafe-inline'` from the served production
  bundle (only needed for Vite HMR in dev) by branching on NODE_ENV.
- schema.sql: profiles are UNIQUE(user_id, name), not global UNIQUE(name),
  matching Worker migration 0002 (applies to freshly-created DBs).
- routes/transactions.js + repositories/tagsRepo.js: the list endpoint
  attached tags in an N+1 loop (one query per row); replace with a single
  batched Map query (getTagsForTransactions).

Adds a unit test for the batched tag attach. pnpm -C backend test:unit -> 81.

Note: the audit's "reject negative amounts" was intentionally NOT applied —
negative expenses are a documented, tested refund feature (BE-TX-047 +
the test/e2e/backend-api/transactions.spec.js:786 comment), not corruption.
2026-07-01 20:53:10 +02:00
..