Filed from the second-wave repository audit (issue 69/100). See the audit summary for full category context.
- Location:
backend/src/controllers/user.controller.ts:116-169 vs. backend/src/routes/v1/events.routes.ts:69-141
- Problem: Two near-identical implementations of "paginated events by sender/recipient" exist with different feature sets (one supports comma-separated
type filtering and includes the related stream, the other doesn't) and duplicated regex/where-clause logic.
- Evidence: Two independent handlers covering the same query shape with inconsistent capabilities.
- Suggested implementation: Extract one shared
listEventsForWallet helper supporting the union of both features, used by both endpoints (or consolidate to one endpoint if the duplication is unintentional).
- Acceptance criteria: Both call sites support identical filtering capabilities via one shared implementation.
- Difficulty: M
- Expected impact: Removes feature-parity drift between two endpoints doing the same conceptual job.
backend/src/controllers/user.controller.ts:116-169vs.backend/src/routes/v1/events.routes.ts:69-141typefiltering and includes the related stream, the other doesn't) and duplicated regex/where-clause logic.listEventsForWallethelper supporting the union of both features, used by both endpoints (or consolidate to one endpoint if the duplication is unintentional).