Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Aug 26, 2025

작업 요약

기존 storeId publicCode로 변경

Issue Link

#290

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • Refactor
    • 매장 결제 조회 API가 경로 파라미터로 숫자형 storeId 대신 문자열 publicCode를 사용하도록 변경되었습니다. 요청 경로가 /{storeId} → /{publicCode}로 바뀌었으며, 클라이언트는 publicCode로 호출해야 합니다.
    • 유효하지 않은 코드에 대해 보다 명확한 오류 응답(예: 404) 제공으로 응답 일관성이 향상되었습니다.

@Jjiggu Jjiggu self-assigned this Aug 26, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Aug 26, 2025
@Jjiggu Jjiggu merged commit 895d106 into develop Aug 26, 2025
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

컨트롤러와 서비스 전반에서 식별자를 Long storeId에서 String publicCode로 전환했다. 서비스 구현은 publicCode로 Store를 조회한 뒤 storeId로 결제 정보를 찾도록 변경되었고, StoreRepository 의존성이 추가되었다. 파라미터 유효성 검사와 예외 처리 대상이 publicCode로 교체되었다.

Changes

Cohort / File(s) Change summary
Controller: publicCode로 경로 변수 전환
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java
@GetMapping 경로를 /{storeId}/{publicCode}로 변경. 메서드 시그니처의 파라미터를 Long storeIdString publicCode로 교체. 서비스 호출 인자도 publicCode 사용으로 수정.
Service API: 시그니처 변경
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentService.java
getStorePaymentByStoreId(Long storeId)getStorePaymentByStoreId(String publicCode)로 파라미터 타입 변경. 반환 타입과 메서드명 유지.
Service Impl: publicCode 해석 및 Repository 추가
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java
구현 메서드 파라미터를 String으로 변경. StoreRepository 주입 추가 후 publicCode로 Store 조회, 없으면 StoreNotFoundException. 조회된 storeId로 결제 조회 및 Dto 매핑. null/빈 값 처리에서 StorePaymentParamEmptyException을 publicCode에 적용.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Controller as StorePaymentController
  participant Service as StorePaymentService
  participant StoreRepo as StoreRepository
  participant PayRepo as StorePaymentRepository

  Client->>Controller: GET /store-payment/{publicCode}
  Controller->>Service: getStorePaymentByStoreId(publicCode)
  Service->>Service: validate publicCode (empty/null -> throw)
  Service->>StoreRepo: findByPublicCode(publicCode)
  alt Store not found
    StoreRepo-->>Service: empty
    Service-->>Controller: throw StoreNotFoundException
    Controller-->>Client: 404
  else Store found
    StoreRepo-->>Service: Store(id)
    Service->>PayRepo: findByStoreId(id)
    PayRepo-->>Service: Optional<StorePayment>
    Service->>Service: map to StorePaymentReadDto
    Service-->>Controller: Optional<StorePaymentReadDto>
    Controller-->>Client: 200 or 404 (based on Optional)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • HyemIin

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between acda443 and 390a434.

📒 Files selected for processing (3)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentService.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#290-public-code

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants