[REFACTOR] 불필요한 API 정리#10
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Warning
|
| Layer / File(s) | Summary |
|---|---|
Data Schemas & DTOs src/modules/matches/schemas/*, src/modules/matches/dto/* |
Mongoose schemas (MatchLog, MatchFeedback) and validation DTOs (FindMatchesDto, SubmitFeedbackDto) are deleted entirely. |
Service Implementation src/modules/matches/matches.service.ts, src/modules/partners/partners.service.ts |
MatchesService (including findMatches and submitFeedback methods with scoring logic) is removed; PartnersService.getDebugInfo() method is removed. |
API Controllers & Endpoints src/modules/matches/matches.controller.ts, src/modules/sellers/sellers.controller.ts, src/modules/partners/partners.controller.ts |
MatchesController with GET /matches and POST /matches/:sellerId/feedback endpoints is deleted; SellersController CRUD operations (findOne, create, update, remove) are removed, leaving only findAll; PartnersController.debug() endpoint is removed, leaving only search. |
Module Wiring & Configuration src/app.module.ts, src/modules/matches/matches.module.ts |
MatchesModule class definition is removed; AppModule import list and module configuration drop MatchesModule and add PaymentsModule, SellersModule, and PartnersModule. |
Tests & Specifications src/modules/matches/*.spec.ts, src/modules/sellers/*.spec.ts, src/modules/partners/*.spec.ts |
All MatchesController and MatchesService test suites are deleted; SellersController spec is simplified to test only findAll; SellersService spec removes exception/CRUD test fixtures; PartnersService removes getDebugInfo test and introduces stray numeric statements (lines 239–240). |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related issues
- K-Strata/backend#9: This PR directly fulfills the removal of Matches domain, Sellers CRUD operations, and Partners debug endpoint as described in the issue requirements.
Possibly related PRs
- K-Strata/backend#8: Both PRs involve changes to the Matches feature; the retrieved PR refactors Matches to use Seller instead of Company, while this PR removes the entire Matches module.
- K-Strata/backend#6: The retrieved PR modifies Matches service and schema imports that are completely deleted in this PR, creating a direct code-level overlap.
Poem
🐰 A rabbit hops through deleted code,
MatchesModule takes the final road,
Sellers trim their CRUD, Partners lose their debug,
Clean and lean, the app hops on, snug! ✨
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title '[REFACTOR] 불필요한 API 정리' clearly summarizes the main change: removing unused APIs. It directly reflects the PR's core objective of simplifying the codebase by deleting unnecessary endpoints across Sellers, Partners, and Matches modules. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
refactor/remove-unused-apis
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
- Generate code and open pull requests
- Plan features and break down work
- Investigate incidents and troubleshoot customer tickets together
- Automate recurring tasks and respond to alerts with triggers
- Summarize progress and report instantly
Built for teams:
- Shared memory across your entire org—no repeating context
- Per-thread sandboxes to safely plan and execute work
- Governance built-in—scoped access, auditability, and budget controls
One agent for your entire SDLC. Right inside Slack.
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.
Review rate limit: 0/1 reviews remaining, refill in 52 minutes and 59 seconds.Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/modules/sellers/sellers.service.ts (1)
42-45:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPrevent filter overwrite when both
tagandpartnershipare provided.Line 45 overwrites Line 42, so one condition is silently ignored. If both params are valid together, results will be incorrect.
💡 Proposed fix
- if (tag) filter.tags = tag; + if (tag && partnership) filter.tags = { $all: [tag, partnership] }; + else if (tag) filter.tags = tag; if (country) filter["location.country"] = country; if (size) filter.sizeBucket = size; - if (partnership) filter.tags = partnership; + else if (partnership) filter.tags = partnership;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/modules/sellers/sellers.service.ts` around lines 42 - 45, The filter assignment currently lets the partnership branch overwrite the tag branch (filter.tags set twice); in sellers.service.ts update the logic that builds the filter object (variable filter) so tags are combined instead of overwritten—e.g., when both tag and partnership exist set filter.tags to match both values (use an array or a Mongo $all clause) and if only one exists set filter.tags accordingly; keep the other conditions (filter["location.country"], filter.sizeBucket) unchanged and ensure the code paths that reference tag and partnership (the two if blocks) merge into a single assigned value rather than a second assignment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/modules/sellers/sellers.service.ts`:
- Around line 42-45: The filter assignment currently lets the partnership branch
overwrite the tag branch (filter.tags set twice); in sellers.service.ts update
the logic that builds the filter object (variable filter) so tags are combined
instead of overwritten—e.g., when both tag and partnership exist set filter.tags
to match both values (use an array or a Mongo $all clause) and if only one
exists set filter.tags accordingly; keep the other conditions
(filter["location.country"], filter.sizeBucket) unchanged and ensure the code
paths that reference tag and partnership (the two if blocks) merge into a single
assigned value rather than a second assignment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fbdc6057-440d-41ba-91cf-93161d1df6b0
📒 Files selected for processing (18)
src/app.module.tssrc/modules/matches/dto/find-matches.dto.tssrc/modules/matches/dto/submit-feedback.dto.tssrc/modules/matches/matches.controller.spec.tssrc/modules/matches/matches.controller.tssrc/modules/matches/matches.module.tssrc/modules/matches/matches.service.spec.tssrc/modules/matches/matches.service.tssrc/modules/matches/schemas/match-feedback.schema.tssrc/modules/matches/schemas/match-log.schema.tssrc/modules/partners/partners.controller.spec.tssrc/modules/partners/partners.controller.tssrc/modules/partners/partners.service.spec.tssrc/modules/partners/partners.service.tssrc/modules/sellers/sellers.controller.spec.tssrc/modules/sellers/sellers.controller.tssrc/modules/sellers/sellers.service.spec.tssrc/modules/sellers/sellers.service.ts
💤 Files with no reviewable changes (14)
- src/modules/matches/schemas/match-feedback.schema.ts
- src/modules/partners/partners.controller.ts
- src/app.module.ts
- src/modules/matches/dto/submit-feedback.dto.ts
- src/modules/partners/partners.service.spec.ts
- src/modules/matches/matches.controller.spec.ts
- src/modules/matches/matches.controller.ts
- src/modules/matches/dto/find-matches.dto.ts
- src/modules/partners/partners.service.ts
- src/modules/matches/matches.module.ts
- src/modules/sellers/sellers.service.spec.ts
- src/modules/matches/schemas/match-log.schema.ts
- src/modules/matches/matches.service.ts
- src/modules/matches/matches.service.spec.ts
Resolves #9
불필요한 API 정리
변경 사항
Sellers: 단건 조회 / 생성 / 수정 / 삭제 제거, 목록 검색만 유지Partners:/debug엔드포인트 제거Matches: 도메인 전체 삭제배경
현재 서비스에서 사용되지 않는 엔드포인트를 제거해 코드베이스를 단순화합니다.
추후 필요 시 재구현 예정입니다.
체크리스트
app.module.ts에서MatchesModule참조 제거Summary by CodeRabbit
Release Notes