Skip to content

Feat/20/wallet 입금 API 및 Phase 2 설계 문서 추가#21

Merged
ohhalim merged 7 commits into
developfrom
feat/20/wallet
May 14, 2026
Merged

Feat/20/wallet 입금 API 및 Phase 2 설계 문서 추가#21
ohhalim merged 7 commits into
developfrom
feat/20/wallet

Conversation

@ohhalim
Copy link
Copy Markdown
Owner

@ohhalim ohhalim commented May 14, 2026

Summary

  • 입금 API 구현 및 통합 테스트 추가 (WAL-003)
  • Swagger UI / JWT Bearer 인증 설정 추가
  • Phase 2 PRD, 구현 플랜, Known Issues 문서 추가

Changes

feat

  • WalletController.deposit() — 입금 엔드포인트 (WAL-003)
  • SecurityConfig/swagger-ui/**, /v3/api-docs/** permitAll

docs

  • .docs/v2/PRD.md — Outbox Pattern / Kafka / WebSocket 설계
  • .docs/v2/Plan.md — 이슈별 구현 상세 (docker-compose, OutboxPublisher, WebSocketBroadcaster, 테스트 코드)
  • .docs/v2/ISSUES.md — Phase 1 리뷰 이슈 8건 (BLOCKER 4, IMPROVE 4)

테스트 완료 사항

  • ./gradlew test 통과
  • POST /api/v1/wallets/deposit 호출 시 잔고 증가 확인
  • /swagger-ui/index.html 접근 및 JWT Bearer 인증 동작 확인

관련 이슈

closes #20

Summary by CodeRabbit

Release Notes

  • New Features

    • Added wallet deposit functionality—users can now deposit assets into their wallets with validation for amounts and wallet existence.
    • Added Swagger/OpenAPI documentation for all API endpoints.
  • Documentation

    • Documented Phase 1 known issues and Phase 2 architecture requirements (Outbox Pattern, Kafka integration, WebSocket broadcasting).
  • Tests

    • Added comprehensive wallet deposit API tests covering success and failure scenarios.

Review Change Stack

ohhalim added 7 commits May 14, 2026 13:42
거래소 도메인 관점에서 Kafka/WebSocket 도입 배경 명시.
설계 결정 근거, 면접 Q&A, 이슈별 파일 목록 추가.
PRD: 정상/장애 시퀀스 다이어그램, 장애 시나리오 표, idempotency 명세 추가
Plan: KafkaMessage DTO, WebSocketBroadcaster 전체 구현, 테스트 코드 완성
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6692192e-4513-4b9f-a755-741833e8caf7

📥 Commits

Reviewing files that changed from the base of the PR and between bbc5835 and e3f2419.

📒 Files selected for processing (11)
  • .docs/v2/ISSUES.md
  • .docs/v2/PRD.md
  • .docs/v2/Plan.md
  • build.gradle
  • src/main/java/com/coinflow/common/exception/ErrorCode.java
  • src/main/java/com/coinflow/config/OpenApiConfig.java
  • src/main/java/com/coinflow/config/SecurityConfig.java
  • src/main/java/com/coinflow/wallet/api/WalletController.java
  • src/main/java/com/coinflow/wallet/dto/DepositRequest.java
  • src/main/java/com/coinflow/wallet/service/WalletService.java
  • src/test/java/com/coinflow/wallet/WalletApiTest.java

📝 Walkthrough

Walkthrough

This PR combines Phase 2 strategic planning documentation with implementation of the wallet deposit API feature. Phase 2 planning spans three documents identifying Phase 1 issues, architectural requirements, and a detailed implementation roadmap. The deposit feature adds an authenticated endpoint accepting KRW/BTC deposits, validating amounts, recording ledger entries, and integrating Swagger/OpenAPI documentation.

Changes

Phase 2 Strategic Planning Documentation

Layer / File(s) Summary
Phase 1 Known Issues and Priorities
.docs/v2/ISSUES.md
Categorizes 8 issues from Phase 1 code review by severity: 4 blockers (orderbook state consistency, concurrent queue access, row locking, input validation) and 4 improvements (outbox envelope/dedup, pagination, test cleanup, environment config).
Phase 2 Requirements and Architecture
.docs/v2/PRD.md
Defines Phase 2 problem (decoupling event delivery from core trading), solution architecture (Outbox Pattern + Kafka + WebSocket STOMP), fault scenarios, at-least-once delivery semantics, and Phase 3 expansion (CDC, dedup table).
Phase 2 Implementation Plan
.docs/v2/Plan.md
Specifies Issues #19–22: Kafka environment setup, Outbox Publisher with state mutation and polling, WebSocket broadcaster with STOMP listeners, and E2E test strategy using Testcontainers and EmbeddedKafka.

Wallet Deposit API Feature

Layer / File(s) Summary
Swagger/OpenAPI Infrastructure
build.gradle, src/main/java/com/coinflow/config/OpenApiConfig.java, src/main/java/com/coinflow/config/SecurityConfig.java
Adds springdoc-openapi-starter-webmvc-ui dependency, creates OpenAPI bean with JWT bearer authentication scheme, and permits unauthenticated Swagger endpoint access.
Error Codes for Wallet Validation
src/main/java/com/coinflow/common/exception/ErrorCode.java
Extends ErrorCode with WALLET_NOT_FOUND (404) and INVALID_AMOUNT (400) constants for deposit failure scenarios.
Deposit Endpoint and Service
src/main/java/com/coinflow/wallet/api/WalletController.java, src/main/java/com/coinflow/wallet/dto/DepositRequest.java, src/main/java/com/coinflow/wallet/service/WalletService.java
New POST /api/v1/wallets/deposit endpoint reads authenticated user from JWT, accepts DepositRequest record (asset, amount), validates amount as positive BigDecimal, retrieves wallet with row lock, creates SEED_DEPOSIT ledger entry, and returns updated WalletResponse.
Deposit API Tests
src/test/java/com/coinflow/wallet/WalletApiTest.java
Covers successful KRW and BTC deposits with ledger verification, rejects non-existent wallets and invalid/zero amounts, confirms missing auth returns 401, and includes depositViaApi helper for authenticated requests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A spring in our step, wallets now deep,
Phase 2 dreams in the docs we keep,
Outbox queues and Kafka's flow,
Deposit coins with swagger's glow,
Testing secured, the future's bright!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/20/wallet

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.

@ohhalim ohhalim merged commit 77a02c8 into develop May 14, 2026
1 of 2 checks passed
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.

[Feat]: wallets api 추가 구현

1 participant