-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature/#102] withdrawal MviViewmodel 제거 및 API Response를 추가합니다. #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough회원탈퇴 기능에 탈퇴 사유 문자열 매개변수를 추가하고, 프레젠테이션 계층의 상태 관리를 MVI에서 Orbit 기반 아키텍처로 변경합니다. 데이터, 도메인, 프레젠테이션 계층 전체에서 API 메서드 서명이 업데이트되고, 새로운 WithdrawalReasonRequest 모델이 추가됩니다. Changes
Sequence DiagramsequenceDiagram
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: 성공 다이얼로그 표시
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
📒 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.ktpresentation/src/main/java/com/threegap/bitnagil/presentation/withdrawal/WithdrawalViewModel.ktpresentation/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: 명시적 상태 초기화 패턴이 잘 적용되었습니다.기본값을 제거하고
INITcompanion 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. ThefinalWithdrawalReasonproperty is correctly defined as a computed property inWithdrawalState(lines 13-14) and thewithdrawal()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.
data/src/main/java/com/threegap/bitnagil/data/auth/model/request/WithdrawalReasonResponse.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
📒 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 메서드들과 일관된 패턴을 따르고 있습니다.
l5x5l
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
[ PR Content ]
Related issue
Screenshot 📸
Work Description
To Reviewers 📢
Summary by CodeRabbit
릴리스 노트
새 기능
개선 사항
✏️ Tip: You can customize this high-level summary in your review settings.