Skip to content

[REFACTOR] 불필요한 API 정리#10

Merged
Takch02 merged 5 commits into
mainfrom
refactor/remove-unused-apis
May 3, 2026
Merged

[REFACTOR] 불필요한 API 정리#10
Takch02 merged 5 commits into
mainfrom
refactor/remove-unused-apis

Conversation

@Takch02

@Takch02 Takch02 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Resolves #9

불필요한 API 정리

변경 사항

  • Sellers: 단건 조회 / 생성 / 수정 / 삭제 제거, 목록 검색만 유지
  • Partners: /debug 엔드포인트 제거
  • Matches: 도메인 전체 삭제

배경

현재 서비스에서 사용되지 않는 엔드포인트를 제거해 코드베이스를 단순화합니다.
추후 필요 시 재구현 예정입니다.

체크리스트

  • 타입스크립트 컴파일 오류 없음
  • 관련 테스트 파일 함께 정리
  • app.module.ts에서 MatchesModule 참조 제거

Summary by CodeRabbit

Release Notes

  • Removals
    • Removed seller match search and feedback submission functionality
    • Removed partners debug information endpoint
    • Simplified sellers API: create, update, and delete operations removed; listing and search remain

Takch02 and others added 3 commits May 3, 2026 22:59
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Takch02 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 59 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4dc48fd5-3b95-4a18-870f-74265c7211a7

📥 Commits

Reviewing files that changed from the base of the PR and between a487452 and 7508075.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • src/modules/sellers/sellers.service.ts

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

This PR removes the entire Matches module from the application and simplifies the Partners and Sellers modules by eliminating debug endpoints and CRUD operations, leaving only search/list functionality. AppModule is updated to remove MatchesModule from its imports and to wire in PaymentsModule instead.

Changes

Feature Domain Removal and API Simplification

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.

👉 Get started


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.

❤️ Share
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Prevent filter overwrite when both tag and partnership are 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

📥 Commits

Reviewing files that changed from the base of the PR and between 632c944 and a487452.

📒 Files selected for processing (18)
  • src/app.module.ts
  • src/modules/matches/dto/find-matches.dto.ts
  • src/modules/matches/dto/submit-feedback.dto.ts
  • src/modules/matches/matches.controller.spec.ts
  • src/modules/matches/matches.controller.ts
  • src/modules/matches/matches.module.ts
  • src/modules/matches/matches.service.spec.ts
  • src/modules/matches/matches.service.ts
  • src/modules/matches/schemas/match-feedback.schema.ts
  • src/modules/matches/schemas/match-log.schema.ts
  • src/modules/partners/partners.controller.spec.ts
  • src/modules/partners/partners.controller.ts
  • src/modules/partners/partners.service.spec.ts
  • src/modules/partners/partners.service.ts
  • src/modules/sellers/sellers.controller.spec.ts
  • src/modules/sellers/sellers.controller.ts
  • src/modules/sellers/sellers.service.spec.ts
  • src/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

@Takch02 Takch02 merged commit 39a1e45 into main May 3, 2026
3 checks passed
@Takch02 Takch02 deleted the refactor/remove-unused-apis branch May 3, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 불필요한 API 제거

1 participant