chore: simplify codebase reuse, quality, and efficiency #35
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/simplify-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Codebase-wide simplify pass: extract shared utilities, fix duplicated patterns, address efficiency wins. No behavior changes intended.
What changed
New shared utility
src/common/db-helpers.ts: `ownerOrGlobal`, `ilikeContains`, `isUniqueViolation`, `awaitAllOrThrowFirst`.Reuse
Efficiency
Quality
Deferred
See `docs/simplify-followups.md` for items intentionally not addressed - notably batching the per-row inserts in `import.service.commitData` (~10-15x faster on large imports) and removing the duplicate `computeCounts` call from `import.commit`. Both need targeted review.
Test plan
🤖 Generated with Claude Code
Add IdParam decorator wrapping ParseUUIDPipe and apply it to every @Param('id') across all controllers. Non-UUIDs now fail with 400 at the boundary instead of leaking pg 22P02 errors from Drizzle. Migrate seeded changelog ids from human-readable slugs (e.g. seed-changelog-v5-0-0) to deterministic v7 UUIDs so admin update/delete endpoints work with the new validation. Migration 0022 drops the legacy rows; the cascade FK on changelog_item.entry_id removes orphans, and the seed reinserts with the UUID constants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>