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)