Skip to content

Conversation

@wjdrjs00
Copy link
Member

@wjdrjs00 wjdrjs00 commented Dec 3, 2025

[ PR Content ]

Related issue

Screenshot 📸

  • N/A

Work Description

  • MviViewModel 제거
  • api 응답 필드 추가(탈퇴사유)

To Reviewers 📢

  • N/A

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 회원 탈퇴 시 탈퇴 사유를 입력할 수 있도록 개선했습니다.
  • 개선 사항

    • 회원 탈퇴 화면의 상태 관리 아키텍처를 개선하여 UI 반응성이 향상되었습니다.
    • 탈퇴 확인 다이얼로그 및 화면 네비게이션 처리가 최적화되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@wjdrjs00 wjdrjs00 requested a review from l5x5l December 3, 2025 17:16
@wjdrjs00 wjdrjs00 self-assigned this Dec 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

회원탈퇴 기능에 탈퇴 사유 문자열 매개변수를 추가하고, 프레젠테이션 계층의 상태 관리를 MVI에서 Orbit 기반 아키텍처로 변경합니다. 데이터, 도메인, 프레젠테이션 계층 전체에서 API 메서드 서명이 업데이트되고, 새로운 WithdrawalReasonRequest 모델이 추가됩니다.

Changes

Cohort / File(s) 변경 요약
회원탈퇴 API 계층
data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthRemoteDataSource.kt, data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt, data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt
회원탈퇴 메서드 서명이 withdrawal()withdrawal(reason: String)으로 변경되었으며, AuthService.postWithdrawal()에서 WithdrawalReasonRequest를 요청 본문으로 수락하도록 업데이트됨
요청 모델
data/src/main/java/com/threegap/bitnagil/data/auth/model/request/WithdrawalReasonRequest.kt
탈퇴 사유를 담는 새로운 @Serializable 데이터 클래스 추가
리포지토리 및 유스케이스 계층
data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt, domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt, domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/WithdrawalUseCase.kt
모든 회원탈퇴 메서드에서 reason: String 매개변수 추가 및 호출 체인 전체에 사유 전달
프레젠테이션 계층 - 아키텍처 마이그레이션
presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalViewModel.kt, presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalScreen.kt
MviViewModel에서 ContainerHost/ViewModel 기반으로 변경, Orbit Compose API 도입, intent 기반 콜백을 직접 메서드 호출로 변경
프레젠테이션 계층 - 상태 모델
presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalState.kt, presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalSideEffect.kt, presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalIntent.kt
WithdrawalState에서 MviState 제거 및 INIT 동반 객체 추가, WithdrawalSideEffect에서 MviSideEffect 제거, WithdrawalIntent 파일 삭제

Sequence Diagram

sequenceDiagram
    participant UI as WithdrawalScreen
    participant VM as WithdrawalViewModel
    participant UC as WithdrawalUseCase
    participant Repo as AuthRepository
    participant Service as AuthService
    participant API as Backend

    UI->>VM: withdrawal(reason)
    activate VM
    VM->>VM: 상태 업데이트<br/>(isLoading=true)
    VM->>UC: invoke(reason)
    activate UC
    UC->>Repo: withdrawal(reason)
    activate Repo
    Repo->>Service: postWithdrawal(WithdrawalReasonRequest(reason))
    activate Service
    Service->>API: POST /withdrawal
    activate API
    API-->>Service: BaseResponse<Unit>
    deactivate API
    Service-->>Repo: 성공
    deactivate Service
    Repo->>Repo: 토큰 정리
    Repo-->>UC: Result.success()
    deactivate Repo
    UC-->>VM: Result.success()
    deactivate UC
    VM->>VM: 상태 업데이트<br/>(isLoading=false,<br/>showSuccessDialog=true)
    VM->>VM: NavigateToLogin<br/>사이드 이펙트 발행
    deactivate VM
    VM-->>UI: 성공 상태 & 사이드 이펙트
    UI->>UI: 성공 다이얼로그 표시
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • WithdrawalViewModel.kt: MviViewModel에서 ContainerHost/ViewModel으로의 대규모 아키텍처 마이그레이션, 새로운 public 메서드 추가, 상태 관리 로직 변경
  • WithdrawalScreen.kt: 상태/사이드이펙트 수집 방식 변경 (collectAsStateWithLifecycle → collectAsState), intent 기반 콜백에서 직접 메서드 호출로 전환
  • WithdrawalState.kt: MviState 제거, @Parcelize 제거, INIT 동반 객체 패턴 도입으로 인한 초기화 로직 변경
  • 계층 간 메서드 서명 변경: reason 매개변수 추가로 인한 데이터/도메인 계층의 연쇄적 변경 (정합성 검증 필요)
  • WithdrawalIntent.kt 삭제: 안전성 검증 필요 (모든 참조 제거 확인)

Poem

🐰 탈퇴 사유를 담아 흐르고,
아키텍처는 MVI에서 Orbit으로 도약!
계층 전체 정렬되고, 상태 명확해지니,
사용자 여정 한 번에 맞춘다네. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항인 MviViewModel 제거와 탈퇴사유 API 필드 추가를 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으며, 관련 이슈, 작업 내용, 리뷰어 항목이 모두 포함되어 있습니다.
Linked Issues check ✅ Passed 변경사항이 이슈 #102의 회원탈퇴 화면 API 연동 요구사항을 충족합니다. MviViewModel 제거 및 탈퇴사유 파라미터 추가로 API 연동을 완료했습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #102의 회원탈퇴 API 연동 및 MviViewModel 리팩토링 범위 내에 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#102-withdrawal-api

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.

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50043f9 and 9ef1c36.

📒 Files selected for processing (12)
  • data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthRemoteDataSource.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/model/request/WithdrawalReasonResponse.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (2 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt (1 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/WithdrawalUseCase.kt (1 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalScreen.kt (3 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalViewModel.kt (1 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalIntent.kt (0 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalSideEffect.kt (1 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalState.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalIntent.kt
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-13T09:06:19.028Z
Learnt from: wjdrjs00
Repo: YAPP-Github/Bitnagil-Android PR: 101
File: presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt:61-67
Timestamp: 2025-08-13T09:06:19.028Z
Learning: In Android ViewModels, when logout success triggers navigation to a different screen (like NavigateToLogin), the current ViewModel's lifecycle ends, so loading states don't need to be explicitly reset in the success case since the ViewModel will be destroyed.

Applied to files:

  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalSideEffect.kt
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalViewModel.kt
  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalScreen.kt
📚 Learning: 2025-07-23T13:31:46.809Z
Learnt from: l5x5l
Repo: YAPP-Github/Bitnagil-Android PR: 41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, Parcelize annotation works correctly without explicitly adding Parcelable implementation.

Applied to files:

  • presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalState.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: build
🔇 Additional comments (20)
presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalSideEffect.kt (1)

3-6: MviSideEffect 의존성 제거가 올바르게 적용되었습니다.

Orbit Container 기반 아키텍처로의 마이그레이션이 깔끔하게 진행되었습니다. sealed interface가 독립적으로 잘 정의되어 있습니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/model/WithdrawalState.kt (1)

3-25: 명시적 상태 초기화 패턴이 잘 적용되었습니다.

기본값을 제거하고 INIT companion object를 도입한 것은 의도적인 상태 관리를 강제하는 좋은 리팩토링입니다. Orbit Container 패턴과 잘 어울립니다.

data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1)

31-34: 탈퇴 사유 전달 로직이 올바르게 구현되었습니다.

reason 파라미터를 WithdrawalReasonResponse로 래핑하여 서비스 레이어에 전달하는 구현이 정확합니다. 단, WithdrawalReasonResponse의 네이밍 이슈가 해결되면 import도 함께 업데이트되어야 합니다.

domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/WithdrawalUseCase.kt (1)

9-9: 유즈케이스 시그니처 변경이 올바르게 적용되었습니다.

reason 파라미터를 repository 레이어로 정확하게 전달하고 있습니다.

domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt (1)

10-10: 리포지토리 인터페이스 변경이 일관되게 적용되었습니다.

withdrawal 메서드에 reason 파라미터가 추가되었고, PR 내 모든 구현체와 호출처가 함께 업데이트되었습니다.

data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (1)

26-27: API 서비스 메서드가 올바르게 업데이트되었습니다.

@Body 어노테이션과 함께 WithdrawalReasonResponse를 요청 바디로 받도록 정확하게 구현되었습니다. WithdrawalReasonResponse의 네이밍이 수정되면 이 import도 함께 업데이트되어야 합니다.

data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthRemoteDataSource.kt (1)

11-11: 데이터소스 인터페이스가 일관되게 업데이트되었습니다.

withdrawal 메서드에 reason 파라미터가 추가되어 구현체와 일치합니다.

data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt (1)

32-36: LGTM!

탈퇴 사유 파라미터가 올바르게 전달되고 있으며, 성공 시 토큰 정리 로직도 기존 패턴과 일관성 있게 유지되고 있습니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalScreen.kt (5)

46-47: LGTM!

Orbit Compose API로의 마이그레이션에 필요한 올바른 import입니다.


51-51: LGTM!

ViewModel 파라미터 노출로 테스트 가능성이 향상되었으며, 기본값 제공으로 기존 호출 코드와의 호환성도 유지됩니다.


55-62: LGTM!

Orbit Compose API를 사용한 상태 및 사이드 이펙트 수집이 올바르게 구현되었습니다.


66-76: LGTM!

Intent 기반 방식에서 직접 메서드 호출로 전환이 깔끔하게 이루어졌으며, 모든 콜백이 올바르게 연결되었습니다.


222-226: LGTM!

Preview에 배경 추가로 가시성이 개선되었으며, WithdrawalState.INIT 사용으로 초기 상태 설정이 더 명확해졌습니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalViewModel.kt (7)

3-19: LGTM!

MviViewModel에서 Orbit ContainerHost로의 마이그레이션이 올바르게 구현되었습니다. Container 초기화도 적절합니다.


21-25: LGTM!

약관 동의 토글 로직이 올바르게 구현되었습니다.


27-31: LGTM!

커스텀 사유 텍스트 업데이트가 올바르게 구현되었습니다.


33-37: LGTM!

사전 정의된 탈퇴 사유 선택 시 커스텀 텍스트를 초기화하는 로직이 적절합니다.


55-59: LGTM!

뒤로가기 네비게이션이 올바르게 구현되었습니다.


61-65: LGTM!

로그인 화면으로의 네비게이션이 올바르게 구현되었습니다.


39-53: No issues found. The finalWithdrawalReason property is correctly defined as a computed property in WithdrawalState (lines 13-14) and the withdrawal() method properly uses it. The implementation follows the correct pattern for this use case, with the success dialog state being managed locally and navigation handled separately from the UI layer.

@wjdrjs00 wjdrjs00 added ✨ Feature 새로운 기능 구현 🔨 Refactor 기존 기능 개선 🧤 대현 labels Dec 4, 2025
Copy link

@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)
data/src/main/java/com/threegap/bitnagil/data/auth/model/request/WithdrawalReasonRequest.kt (1)

6-9: 깔끔한 구현입니다!

데이터 클래스 구조가 명확하고 직렬화 설정이 적절합니다. 선택적으로, 빈 문자열이나 길이 제한에 대한 유효성 검사를 고려해볼 수 있지만, 일반적으로 백엔드에서 이를 처리하므로 현재 구현으로 충분합니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef1c36 and 1edd96d.

📒 Files selected for processing (3)
  • data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/model/request/WithdrawalReasonRequest.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
  • safeUnitApiCall (27-35)
⏰ 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: build
🔇 Additional comments (2)
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1)

31-34: 변경사항이 올바르게 구현되었습니다!

탈퇴 사유를 받아 WithdrawalReasonRequest로 변환하는 로직이 명확하고, 기존의 safeUnitApiCall 패턴을 일관되게 따르고 있습니다.

data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (1)

27-27: API 메서드 시그니처가 올바르게 업데이트되었습니다!

@Body 어노테이션을 사용한 요청 본문 처리가 적절하며, 다른 API 메서드들과 일관된 패턴을 따르고 있습니다.

Copy link
Contributor

@l5x5l l5x5l left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@wjdrjs00 wjdrjs00 merged commit 3e621ed into develop Dec 4, 2025
2 checks passed
@wjdrjs00 wjdrjs00 deleted the feature/#102-withdrawal-api branch December 4, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 구현 🔨 Refactor 기존 기능 개선 🧤 대현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 회원탈퇴 화면을 구현합니다.

3 participants