Skip to content

[Refactor] 에스크로 API 응답 필드 추상화 및 Swagger 명세 고도화#45

Merged
Takch02 merged 5 commits into
mainfrom
refactor/escrow-api-enhancement
May 12, 2026
Merged

[Refactor] 에스크로 API 응답 필드 추상화 및 Swagger 명세 고도화#45
Takch02 merged 5 commits into
mainfrom
refactor/escrow-api-enhancement

Conversation

@Takch02

@Takch02 Takch02 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Resolves #44

개요

에스크로 관련 API의 응답 구조를 '나(my)'와 '상대방(partner)' 관점으로 추상화하여 보안을 강화하고, 클라이언트의 사용 편의성을 개선했습니다. 또한, 클래스 기반 DTO와 Swagger 데코레이터를 적용하여 API 문서의 정확도를 높였습니다.

주요 변경 사항

  • 응답 필드 추상화 및 보안 강화:
    • buyerId/sellerId 등 참여자 정보를 myId/partnerId 등으로 매핑하여 내부 ID 노출을 최소화하고 클라이언트 로직을 단순화했습니다.
    • 응답 객체에서 원본 필드들을 명시적으로 제거하여 데이터 노출을 제한했습니다.
  • DTO 기반 리팩토링:
    • EscrowPaymentResponse, EscrowPaymentListResponse DTO를 신설하여 서비스와 컨트롤러 간의 반환 타입을 표준화했습니다.
  • Swagger 문서 고도화:
    • 컨트롤러에 실제 응답 스키마와 필드 설명을 추가하여 프론트엔드에서 API 스펙을 직관적으로 확인할 수 있도록 개선했습니다.
  • 예외 처리 개선:
    • 지갑 주소로 유저 조회 실패 시 WalletUserNotFoundException을 던지도록 하여 에러 사유를 명확히 했습니다.
  • 테스트 코드 안정화:
    • 리팩토링된 응답 구조를 검증하도록 E2E 테스트를 업데이트하고, 서비스 유닛 테스트의 모킹 로직(toObject() 등)을 보완했습니다.

@coderabbitai

coderabbitai Bot commented May 12, 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 15 minutes and 18 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c1b51a8-1ec6-44d4-ab5a-8fee5b7f0495

📥 Commits

Reviewing files that changed from the base of the PR and between db28e14 and 118dffc.

📒 Files selected for processing (7)
  • src/common/exceptions/escrow.exceptions.ts
  • src/modules/escrow-payments/__tests__/create.spec.ts
  • src/modules/escrow-payments/__tests__/helpers.ts
  • src/modules/escrow-payments/dto/escrow-payment-response.dto.ts
  • src/modules/escrow-payments/escrow-payments-crud.service.ts
  • src/modules/escrow-payments/escrow-payments.controller.ts
  • test/escrow-mock.e2e-spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/escrow-api-enhancement

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Takch02 Takch02 merged commit dbf0965 into main May 12, 2026
3 checks passed
@Takch02 Takch02 deleted the refactor/escrow-api-enhancement branch May 12, 2026 05:45
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 응답 추상화 및 Swagger 명세 고도화

1 participant