Skip to content

feat: 회원 탈퇴 API 연동#113

Merged
easyhooon merged 1 commit intodevelopfrom
BOOK-216-feature/#103
Aug 6, 2025
Merged

feat: 회원 탈퇴 API 연동#113
easyhooon merged 1 commit intodevelopfrom
BOOK-216-feature/#103

Conversation

@easyhooon
Copy link
Copy Markdown
Contributor

@easyhooon easyhooon commented Aug 6, 2025

약관 동의 상태 업데이트, 사용자 프로필 조회 API endpoint 변경 반영

🔗 관련 이슈

📙 작업 설명

  • 회원탈퇴 API 연동 및 회원탈퇴 플로우 구현

🧪 테스트 내역 (선택)

  • 주요 기능 정상 동작 확인
  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

📸 스크린샷 또는 시연 영상 (선택)

기능 미리보기 기능 미리보기
기능 설명 기능 설명

💬 추가 설명 or 리뷰 포인트 (선택)

  • 카카오 회원탈퇴 API 환경이 서버에 구축되면, 정상 동작할듯합니다.

Summary by CodeRabbit

  • 신규 기능

    • 회원 탈퇴 기능이 추가되었습니다. 설정 화면에서 탈퇴를 진행할 수 있습니다.
  • 버그 수정

    • 회원 정보 및 약관 동의 관련 일부 경로가 변경되어 더 정확한 사용자 정보 처리가 가능합니다.

약관 동의 상태 업데이트, 사용자 프로필 조회 API endpoint 변경 반영
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 6, 2025

Walkthrough

회원탈퇴(Withdraw) API 연동이 전반적으로 구현되었습니다. AuthRepository에 withdraw 함수가 추가되고, DefaultAuthRepository에서 실제 API 호출 및 토큰 삭제 로직이 구현되었습니다. ReedService의 엔드포인트 경로가 일부 변경되고 withdraw 엔드포인트가 추가되었습니다. SettingsPresenter에서 탈퇴 이벤트 처리 로직이 완성되었습니다.

Changes

Cohort / File(s) Change Summary
AuthRepository 인터페이스 확장
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
withdraw() suspend 함수가 인터페이스에 추가됨
AuthRepository 구현 및 로직 추가
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt
API 호출 및 토큰 삭제를 포함한 withdraw() 구현. 기존 패턴(runSuspendCatching)과 일관성 유지
ReedService 엔드포인트 변경 및 추가
core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt
회원탈퇴용 withdraw() 함수(@delete) 추가, 일부 엔드포인트 경로 변경(terms-agreement, me)
SettingsPresenter 탈퇴 이벤트 처리
feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt
Withdraw 이벤트 발생 시 API 호출, 성공 시 로그인 화면으로 이동, 실패 시 에러 핸들링 및 토스트 노출 등 실제 탈퇴 플로우 완성

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsPresenter
    participant AuthRepository
    participant ReedService
    participant Navigator

    User->>SettingsPresenter: Withdraw 이벤트 발생
    SettingsPresenter->>AuthRepository: withdraw() 호출
    AuthRepository->>ReedService: withdraw() API 요청
    ReedService-->>AuthRepository: Result 반환
    AuthRepository-->>SettingsPresenter: 결과 반환
    alt 성공
        SettingsPresenter->>Navigator: 로그인 화면으로 이동(루트 리셋)
    else 실패
        SettingsPresenter->>SettingsPresenter: 에러 핸들링 및 토스트 노출
        opt 로그인 필요 에러
            SettingsPresenter->>Navigator: 로그인 화면으로 이동(루트 리셋)
        end
    end
    SettingsPresenter->>SettingsPresenter: 로딩 상태 false로 변경
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
회원탈퇴 API 연동 및 로그인 이동 플로우 구현 (#103)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항과 관련 없는 코드 변경은 발견되지 않았습니다.)

Suggested reviewers

  • seoyoon513

Poem

🐇
탈퇴 버튼, 살짝 눌러
API 타고 훌쩍 떠나
토큰 정리, 로그인으로
깔끔하게 흐름도 새로
북잇의 밤, 코드가 춤추네

— 코딩토끼 드림 🥕

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-216-feature/#103

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt (1)

107-134: 회원 탈퇴 이벤트 처리가 잘 구현되었습니다.

기존 로그아웃 로직과 일관된 패턴으로 구현되어 있고, 코루틴을 통한 비동기 처리, 로딩 상태 관리, 에러 핸들링, 화면 네비게이션이 모두 적절히 처리되었습니다.

다만, 133번 라인에서 bottom sheet를 즉시 숨기는 것보다는 성공 시에만 숨기도록 하는 것이 더 나은 UX를 제공할 수 있습니다:

                is SettingsUiEvent.Withdraw -> {
+                   isWithdrawBottomSheetVisible = false
                    scope.launch {
                        try {
                            isLoading = true
                            authRepository.withdraw()
                                .onSuccess {
                                    navigator.resetRoot(LoginScreen)
                                }
                                .onFailure { exception ->
                                    val handleErrorMessage = { message: String ->
                                        Logger.e(message)
                                        sideEffect = SettingsSideEffect.ShowToast(message)
                                    }

                                    handleException(
                                        exception = exception,
                                        onError = handleErrorMessage,
                                        onLoginRequired = {
                                            navigator.resetRoot(LoginScreen)
                                        },
                                    )
                                }
                        } finally {
                            isLoading = false
                        }
                    }
-                   isWithdrawBottomSheetVisible = false
                }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b430c06 and b0fbc05.

📒 Files selected for processing (4)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (1 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt (1 hunks)
  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt (2 hunks)
  • feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in the reed-android project's termsagreementscreen.kt, the ontermdetailclick event is intentionally ...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#35
File: feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/TermsAgreementScreen.kt:127-127
Timestamp: 2025-07-09T01:14:29.836Z
Learning: In the Reed-Android project's TermsAgreementScreen.kt, the OnTermDetailClick event is intentionally passed an empty string for the URL parameter because the actual URLs for terms detail pages haven't been decided yet. This is a temporary implementation that will be updated once the URLs are finalized.

Applied to files:

  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-build
🔇 Additional comments (5)
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (1)

11-11: 인터페이스에 withdraw() 메서드 추가가 적절합니다.

기존 auth 메서드들과 일관된 시그니처를 사용하며, suspend 함수로 비동기 처리를 지원하고 Result 반환 타입을 통해 성공/실패를 명확히 처리할 수 있습니다.

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt (1)

34-37: withdraw() 메서드 구현이 올바릅니다.

logout()와 동일한 패턴으로 구현되어 일관성을 유지하며, API 호출 후 토큰을 정리하는 로직이 보안상 적절합니다. runSuspendCatching을 통한 예외 처리도 기존 패턴을 따르고 있습니다.

core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt (3)

20-20: DELETE import 추가가 적절합니다.

회원 탈퇴 API를 위한 HTTP DELETE 메서드 import가 올바르게 추가되었습니다.


39-40: 회원 탈퇴 API 엔드포인트가 올바르게 정의되었습니다.

@delete 어노테이션과 "api/v1/auth/withdraw" 경로를 사용한 것이 RESTful API 설계 원칙에 부합하며, 다른 인증 관련 엔드포인트들과 일관성을 유지합니다.


42-47: API 엔드포인트 재구성이 논리적으로 잘 되었습니다.

사용자 관련 엔드포인트들을 "User endpoints" 섹션으로 분류하고, 경로를 "api/v1/users/me"로 통일한 것이 API 구조를 더 명확하게 만듭니다. agreeTerms와 getUserProfile 모두 사용자별 리소스이므로 이 변경이 적절합니다.

Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 left a comment

Choose a reason for hiding this comment

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

서버는 400이지만 코드는 만점이기 때문에 Approve~

@easyhooon easyhooon merged commit a42350b into develop Aug 6, 2025
6 checks passed
@easyhooon easyhooon deleted the BOOK-216-feature/#103 branch August 6, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-216/feat] 회원탈퇴 API 연동

2 participants