From 344acbf11bc92dcbbc9aad73cc8d01087c030f5d Mon Sep 17 00:00:00 2001 From: YeongSang Jeon Date: Sat, 25 Nov 2023 18:23:51 +0900 Subject: [PATCH] =?UTF-8?q?[=20Fix=20]=20:=20=ED=9A=8C=EC=9B=90=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=EA=B8=B0=EB=8A=A5=EC=9D=98=20UseCase=20=EB=AA=85?= =?UTF-8?q?=EC=B9=AD=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 'Delete' 라는 명칭이 어드민 기능 구현시 혼동을 줄 수 있어, 회원탈퇴를 명확히 나타내는 이름으로 수정합니다. --- ...MemberInfoUseCase.kt => WithdrawMemberInfoUseCase.kt} | 9 +++++++-- .../ui/member/setting/MemberSettingViewModel.kt | 9 ++++----- 2 files changed, 11 insertions(+), 7 deletions(-) rename domain/src/main/java/com/yapp/domain/usecases/{DeleteMemberInfoUseCase.kt => WithdrawMemberInfoUseCase.kt} (67%) diff --git a/domain/src/main/java/com/yapp/domain/usecases/DeleteMemberInfoUseCase.kt b/domain/src/main/java/com/yapp/domain/usecases/WithdrawMemberInfoUseCase.kt similarity index 67% rename from domain/src/main/java/com/yapp/domain/usecases/DeleteMemberInfoUseCase.kt rename to domain/src/main/java/com/yapp/domain/usecases/WithdrawMemberInfoUseCase.kt index 3fd7cc49..c599ee88 100644 --- a/domain/src/main/java/com/yapp/domain/usecases/DeleteMemberInfoUseCase.kt +++ b/domain/src/main/java/com/yapp/domain/usecases/WithdrawMemberInfoUseCase.kt @@ -4,9 +4,14 @@ import com.yapp.domain.repository.LocalRepository import com.yapp.domain.repository.MemberRepository import javax.inject.Inject -class DeleteMemberInfoUseCase @Inject constructor( +/** + * 멤버 **스스로** 회원 탈퇴 기능을 사용할때의 UseCase + * + * 로컬에 저장된 Kakao MemberId를 제거 -> FireStore에 존재하는 데이터를 제거합니다. + */ +class WithdrawMemberInfoUseCase @Inject constructor( private val localRepository: LocalRepository, - private val memberRepository: MemberRepository, + private val memberRepository: MemberRepository ) { suspend operator fun invoke(memberId: Long): Result { diff --git a/presentation/src/main/java/com/yapp/presentation/ui/member/setting/MemberSettingViewModel.kt b/presentation/src/main/java/com/yapp/presentation/ui/member/setting/MemberSettingViewModel.kt index d6ec294c..17c213f6 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/member/setting/MemberSettingViewModel.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/member/setting/MemberSettingViewModel.kt @@ -5,8 +5,7 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics import com.yapp.common.base.BaseViewModel import com.yapp.domain.common.KakaoSdkProviderInterface import com.yapp.domain.model.Team -import com.yapp.domain.model.types.TeamType -import com.yapp.domain.usecases.DeleteMemberInfoUseCase +import com.yapp.domain.usecases.WithdrawMemberInfoUseCase import com.yapp.domain.usecases.GetConfigUseCase import com.yapp.domain.usecases.GetCurrentMemberInfoUseCase import com.yapp.domain.usecases.GetMemberIdUseCase @@ -20,7 +19,7 @@ class MemberSettingViewModel @Inject constructor( private val kakaoSdkProvider: KakaoSdkProviderInterface, private val getMemberIdUseCase: GetMemberIdUseCase, private val getCurrentMemberInfoUseCase: GetCurrentMemberInfoUseCase, - private val deleteMemberInfoUseCase: DeleteMemberInfoUseCase, + private val withdrawMemberInfoUseCase: WithdrawMemberInfoUseCase, private val getConfigUseCase: GetConfigUseCase, private val shouldShowGuestButtonUseCase: ShouldShowGuestButtonUseCase, ) : @@ -82,7 +81,7 @@ class MemberSettingViewModel @Inject constructor( .onSuccess { memberId -> require(memberId != null) - deleteMemberInfoUseCase(memberId).getOrDefault(defaultValue = false).also { isSuccess -> + withdrawMemberInfoUseCase(memberId).getOrDefault(defaultValue = false).also { isSuccess -> if (!isSuccess) { setState { copy(loadState = MemberSettingContract.LoadState.Idle) } setEffect(MemberSettingContract.MemberSettingUiSideEffect.ShowToast) @@ -141,7 +140,7 @@ class MemberSettingViewModel @Inject constructor( getMemberIdUseCase() .onSuccess { memberId -> require(memberId != null) - deleteMemberInfoUseCase(memberId).getOrDefault(false).also { isSuccess -> + withdrawMemberInfoUseCase(memberId).getOrDefault(false).also { isSuccess -> if (!isSuccess) { setState { copy(loadState = MemberSettingContract.LoadState.Idle) } setEffect(MemberSettingContract.MemberSettingUiSideEffect.ShowToast)