refactor: extract publish helper and deduplicate RequestLike type#697
refactor: extract publish helper and deduplicate RequestLike type#697kamilwronka wants to merge 1 commit intodevelopfrom
Conversation
…te RequestLike type - EventEmitterService: Extract private `publish()` method to eliminate 6 identical try-catch blocks - nest-shared decorators: Export `RequestLike` type from source and import it instead of redefining Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughRefactored EventEmitterService to centralize AMQP publishing logic into a single private Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
publish()method to eliminate 6 identical try-catch blocks. Each public method now delegates to the shared helper, reducing boilerplate by ~30 lines while preserving identical behavior (same exchange, routing keys, and error logging).RequestLiketype fromcreate-required-request-value.decorator.tsand imported it increate-required-unauthorized-request-value.decorator.tsinstead of redefining the same type.Safety
Touched files
apps/api/src/events/services/event-emitter.service.tspackages/nest-shared/src/decorators/create-required-request-value.decorator.tspackages/nest-shared/src/decorators/create-required-unauthorized-request-value.decorator.tsTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit