diff --git a/app/src/main/java/com/afternote/afternote_fe/messaging/FirebaseDevicePushTargetProvider.kt b/app/src/main/java/com/afternote/afternote_fe/messaging/FirebaseDevicePushTargetProvider.kt index 7532b91e90..9828819856 100644 --- a/app/src/main/java/com/afternote/afternote_fe/messaging/FirebaseDevicePushTargetProvider.kt +++ b/app/src/main/java/com/afternote/afternote_fe/messaging/FirebaseDevicePushTargetProvider.kt @@ -1,8 +1,8 @@ package com.afternote.afternote_fe.messaging import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.push.DevicePushTargetProvider +import com.afternote.core.domain.result.runCatchingCancellable import com.google.android.gms.tasks.Task import com.google.firebase.installations.FirebaseInstallations import com.google.firebase.messaging.FirebaseMessaging diff --git a/app/src/main/java/com/afternote/afternote_fe/messaging/PushTargetSynchronizer.kt b/app/src/main/java/com/afternote/afternote_fe/messaging/PushTargetSynchronizer.kt index 869a1f2a05..50883c9336 100644 --- a/app/src/main/java/com/afternote/afternote_fe/messaging/PushTargetSynchronizer.kt +++ b/app/src/main/java/com/afternote/afternote_fe/messaging/PushTargetSynchronizer.kt @@ -1,10 +1,10 @@ package com.afternote.afternote_fe.messaging import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.push.DevicePushTargetProvider import com.afternote.core.domain.repository.auth.AuthRepository import com.afternote.core.domain.repository.push.PushTargetRepository +import com.afternote.core.domain.result.runCatchingCancellable import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock diff --git a/app/src/main/java/com/afternote/afternote_fe/notification/DailyNotificationScheduleSynchronizer.kt b/app/src/main/java/com/afternote/afternote_fe/notification/DailyNotificationScheduleSynchronizer.kt index d1b3703c90..b66e776848 100644 --- a/app/src/main/java/com/afternote/afternote_fe/notification/DailyNotificationScheduleSynchronizer.kt +++ b/app/src/main/java/com/afternote/afternote_fe/notification/DailyNotificationScheduleSynchronizer.kt @@ -3,8 +3,8 @@ package com.afternote.afternote_fe.notification import android.content.Context import com.afternote.core.common.notification.NotificationScheduler import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.auth.AuthRepository +import com.afternote.core.domain.result.runCatchingCancellable import dagger.hilt.android.qualifiers.ApplicationContext import kotlinx.coroutines.flow.distinctUntilChanged import javax.inject.Inject diff --git a/app/src/main/java/com/afternote/afternote_fe/notification/NotificationPermissionViewModel.kt b/app/src/main/java/com/afternote/afternote_fe/notification/NotificationPermissionViewModel.kt index d3e4b7a170..027576bd8c 100644 --- a/app/src/main/java/com/afternote/afternote_fe/notification/NotificationPermissionViewModel.kt +++ b/app/src/main/java/com/afternote/afternote_fe/notification/NotificationPermissionViewModel.kt @@ -1,8 +1,8 @@ package com.afternote.afternote_fe.notification import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.auth.AuthRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.ui.mvi.MviViewModel import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Job diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/PhotoUploadRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/PhotoUploadRepositoryImpl.kt index 55222618f6..5509bad081 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/PhotoUploadRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/PhotoUploadRepositoryImpl.kt @@ -4,9 +4,9 @@ import android.content.Context import android.webkit.MimeTypeMap import androidx.core.net.toUri import com.afternote.core.common.di.IoDispatcher -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.model.UploadedFile import com.afternote.core.domain.repository.PhotoUploadRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.dto.PresignedUrlRequestDto import com.afternote.core.network.model.requireData import com.afternote.core.network.service.ImageApiService diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/UserReceiverRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/UserReceiverRepositoryImpl.kt index 944efe020c..ed785a0346 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/UserReceiverRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/UserReceiverRepositoryImpl.kt @@ -1,13 +1,13 @@ package com.afternote.core.data.repoimpl import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.data.mapper.delivery.toRequestDto import com.afternote.core.data.mapper.user.toDomain import com.afternote.core.datastore.TokenDataSource import com.afternote.core.domain.error.ReceiverRequestRejectedException import com.afternote.core.domain.model.ReceiverListState import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.delivery.DeliveryConditionItem import com.afternote.core.model.delivery.ReceiverDeliveryConditions import com.afternote.core.model.user.Receiver diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/VideoUploadRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/VideoUploadRepositoryImpl.kt index 1a3c5f724c..9483dc9588 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/VideoUploadRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/VideoUploadRepositoryImpl.kt @@ -4,9 +4,9 @@ import android.content.Context import android.net.Uri import androidx.core.net.toUri import com.afternote.core.common.di.IoDispatcher -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.model.UploadedFile import com.afternote.core.domain.repository.VideoUploadRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.dto.PresignedUrlRequestDto import com.afternote.core.network.model.requireData import com.afternote.core.network.service.ImageApiService diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/account/AccountRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/account/AccountRepositoryImpl.kt index ef59dfa342..8e98177639 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/account/AccountRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/account/AccountRepositoryImpl.kt @@ -1,8 +1,8 @@ package com.afternote.core.data.repoimpl.account -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.data.mapper.auth.toDomain import com.afternote.core.domain.repository.account.AccountRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.AccountRegistration import com.afternote.core.model.FoundAccount import com.afternote.core.network.dto.EmailFindRequestDto diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/appversion/AppVersionRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/appversion/AppVersionRepositoryImpl.kt index 08e9f297cd..3f1243525b 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/appversion/AppVersionRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/appversion/AppVersionRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.afternote.core.data.repoimpl.appversion -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.appversion.AppVersionRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.appversion.AppVersionCheck import com.afternote.core.network.dto.AppPlatformDto import com.afternote.core.network.model.requireData diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/AuthRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/AuthRepositoryImpl.kt index c804375420..5883365199 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/AuthRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/AuthRepositoryImpl.kt @@ -1,6 +1,5 @@ package com.afternote.core.data.repoimpl.auth -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.data.mapper.auth.toDomain import com.afternote.core.datastore.LocalStoreRegistry import com.afternote.core.datastore.StoreScope @@ -9,6 +8,7 @@ import com.afternote.core.domain.error.SessionChangedException import com.afternote.core.domain.push.DevicePushTargetProvider import com.afternote.core.domain.repository.auth.AuthRepository import com.afternote.core.domain.repository.push.PushTargetRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.Session import com.afternote.core.model.TokenBundle import com.afternote.core.network.dto.LoginRequestDto diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/LoginFailureTranslation.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/LoginFailureTranslation.kt index 5c82dbda1b..3bb0de07cf 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/LoginFailureTranslation.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/auth/LoginFailureTranslation.kt @@ -1,7 +1,7 @@ package com.afternote.core.data.repoimpl.auth -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.error.CoreAuthFailure +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.ApiException import java.io.IOException diff --git a/core/data/src/main/java/com/afternote/core/data/repoimpl/push/PushTargetRepositoryImpl.kt b/core/data/src/main/java/com/afternote/core/data/repoimpl/push/PushTargetRepositoryImpl.kt index 7ef2cea350..22a963b140 100644 --- a/core/data/src/main/java/com/afternote/core/data/repoimpl/push/PushTargetRepositoryImpl.kt +++ b/core/data/src/main/java/com/afternote/core/data/repoimpl/push/PushTargetRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.afternote.core.data.repoimpl.push -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.push.PushTargetRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.dto.DeletePushTokenRequestDto import com.afternote.core.network.dto.RegisterPushTokenRequestDto import com.afternote.core.network.model.requireStatus diff --git a/core/data/src/test/java/com/afternote/core/data/repoimpl/UploadFailureTranslationTest.kt b/core/data/src/test/java/com/afternote/core/data/repoimpl/UploadFailureTranslationTest.kt index 2ee1da15ac..c940ebe405 100644 --- a/core/data/src/test/java/com/afternote/core/data/repoimpl/UploadFailureTranslationTest.kt +++ b/core/data/src/test/java/com/afternote/core/data/repoimpl/UploadFailureTranslationTest.kt @@ -1,7 +1,7 @@ package com.afternote.core.data.repoimpl -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.error.FileUploadFailure +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.ApiException import org.junit.Assert.assertEquals import org.junit.Assert.assertSame diff --git a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/paging/AfternotePagingSource.kt b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/paging/AfternotePagingSource.kt index 2963fbaa26..33aea24a29 100644 --- a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/paging/AfternotePagingSource.kt +++ b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/paging/AfternotePagingSource.kt @@ -2,7 +2,7 @@ package com.afternote.feature.afternote.data.paging import androidx.paging.PagingSource import androidx.paging.PagingState -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.feature.afternote.data.mapper.toDomainList import com.afternote.feature.afternote.data.service.AfternoteApiService diff --git a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/AfternoteRepositoryImpl.kt b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/AfternoteRepositoryImpl.kt index a25a86d29d..38796b0cd1 100644 --- a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/AfternoteRepositoryImpl.kt +++ b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/AfternoteRepositoryImpl.kt @@ -3,7 +3,7 @@ package com.afternote.feature.afternote.data.repositoryimpl.author import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.PagingData -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.core.network.model.requireStatus import com.afternote.feature.afternote.data.mapper.toBusinessRequest diff --git a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MemorialThumbnailUploadRepositoryImpl.kt b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MemorialThumbnailUploadRepositoryImpl.kt index 836ee4df64..2b58173a6c 100644 --- a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MemorialThumbnailUploadRepositoryImpl.kt +++ b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MemorialThumbnailUploadRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.afternote.feature.afternote.data.repositoryimpl.author import com.afternote.core.common.di.IoDispatcher -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.dto.PresignedUrlRequestDto import com.afternote.core.network.model.requireData import com.afternote.core.network.service.ImageApiService diff --git a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MusicSearchRepositoryImpl.kt b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MusicSearchRepositoryImpl.kt index a6804fd17a..6400d78e50 100644 --- a/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MusicSearchRepositoryImpl.kt +++ b/feature/afternote/data/src/main/kotlin/com/afternote/feature/afternote/data/repositoryimpl/author/MusicSearchRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.afternote.feature.afternote.data.repositoryimpl.author -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.afternote.data.dto.MusicTrackDto import com.afternote.feature.afternote.data.service.MusicApiService import com.afternote.feature.afternote.domain.model.author.playlist.SearchedSong diff --git a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/detail/AfternoteDetailViewModel.kt b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/detail/AfternoteDetailViewModel.kt index 205f5fe2d7..ede9505a1d 100644 --- a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/detail/AfternoteDetailViewModel.kt +++ b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/detail/AfternoteDetailViewModel.kt @@ -3,9 +3,9 @@ package com.afternote.feature.afternote.presentation.detail import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.MyProfileRepository import com.afternote.core.domain.repository.UserProfileCacheRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.afternote.domain.repository.author.AfternoteRepository import com.afternote.feature.afternote.presentation.R import com.afternote.feature.afternote.presentation.navigation.model.AfternoteRoute diff --git a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/AfternoteEditorViewModel.kt b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/AfternoteEditorViewModel.kt index 99ca625c48..f02a2d282c 100644 --- a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/AfternoteEditorViewModel.kt +++ b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/AfternoteEditorViewModel.kt @@ -5,8 +5,8 @@ import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.afternote.domain.AfternoteType import com.afternote.feature.afternote.domain.error.AfternoteFailure import com.afternote.feature.afternote.domain.model.author.CreateAfternoteInput diff --git a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/receiver/SelectReceiverViewModel.kt b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/receiver/SelectReceiverViewModel.kt index 14dd616ffe..3606627b51 100644 --- a/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/receiver/SelectReceiverViewModel.kt +++ b/feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/editor/receiver/SelectReceiverViewModel.kt @@ -4,8 +4,8 @@ import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.afternote.presentation.editor.mapper.toAfternoteEditorReceivers import com.afternote.feature.afternote.presentation.reporting.AfternoteFailureStage import com.afternote.feature.afternote.presentation.reporting.recordAfternoteFailure diff --git a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/paging/ReceiverAfternotePagingSource.kt b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/paging/ReceiverAfternotePagingSource.kt index 9a387391bb..118686ba77 100644 --- a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/paging/ReceiverAfternotePagingSource.kt +++ b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/paging/ReceiverAfternotePagingSource.kt @@ -3,7 +3,7 @@ package com.afternote.feature.receiver.data.paging import androidx.paging.PagingSource import androidx.paging.PagingState import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.feature.receiver.data.error.toReceiverFailure import com.afternote.feature.receiver.data.mapper.toReceiverDomainList diff --git a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverAuthRepositoryImpl.kt b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverAuthRepositoryImpl.kt index b7ba0241fa..6a71e456f4 100644 --- a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverAuthRepositoryImpl.kt +++ b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverAuthRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.afternote.feature.receiver.data.repositoryimpl import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.core.network.model.requireStatus import com.afternote.feature.receiver.data.dto.DeliveryVerificationRequestDto diff --git a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverDeliveryDocumentUploadRepositoryImpl.kt b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverDeliveryDocumentUploadRepositoryImpl.kt index 513ee94c7c..20bcce9f57 100644 --- a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverDeliveryDocumentUploadRepositoryImpl.kt +++ b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverDeliveryDocumentUploadRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.afternote.feature.receiver.data.repositoryimpl import com.afternote.core.common.di.IoDispatcher -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.receiver.data.error.mapReceiverFailure import com.afternote.feature.receiver.domain.repository.ReceiverAuthRepository import com.afternote.feature.receiver.domain.repository.ReceiverDeliveryDocumentUploadRepository diff --git a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverRepositoryImpl.kt b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverRepositoryImpl.kt index dc7ff95df6..e3ff45f4c2 100644 --- a/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverRepositoryImpl.kt +++ b/feature/receiver/data/src/main/kotlin/com/afternote/feature/receiver/data/repositoryimpl/ReceiverRepositoryImpl.kt @@ -4,7 +4,7 @@ import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.PagingData import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.feature.receiver.data.error.mapReceiverFailure import com.afternote.feature.receiver.data.local.ReceiverMasterKeyDataSource diff --git a/feature/setting/domain/src/main/java/com/afternote/feature/setting/domain/UpdateReceiverInfoUseCase.kt b/feature/setting/domain/src/main/java/com/afternote/feature/setting/domain/UpdateReceiverInfoUseCase.kt index 3444b9aa16..66584b725c 100644 --- a/feature/setting/domain/src/main/java/com/afternote/feature/setting/domain/UpdateReceiverInfoUseCase.kt +++ b/feature/setting/domain/src/main/java/com/afternote/feature/setting/domain/UpdateReceiverInfoUseCase.kt @@ -1,7 +1,7 @@ package com.afternote.feature.setting.domain import com.afternote.core.domain.repository.UserReceiverRepository -import kotlinx.coroutines.CancellationException +import com.afternote.core.domain.result.runCatchingCancellable import kotlinx.coroutines.currentCoroutineContext import kotlinx.coroutines.ensureActive import javax.inject.Inject @@ -48,21 +48,13 @@ public class UpdateReceiverInfoUseCase email: String, message: String, ): UpdateReceiverInfoResult { - try { - repository.updateReceiver(receiverId, name, phone, relation, email) - } catch (cancelled: CancellationException) { - throw cancelled - } catch (failure: Throwable) { - return UpdateReceiverInfoResult.BasicInfoFailed(failure) - } + runCatchingCancellable { repository.updateReceiver(receiverId, name, phone, relation, email) } + .onFailure { return UpdateReceiverInfoResult.BasicInfoFailed(it) } currentCoroutineContext().ensureActive() - return try { - repository.updateReceiverMessage(receiverId, message) - UpdateReceiverInfoResult.Success - } catch (cancelled: CancellationException) { - throw cancelled - } catch (_: Throwable) { - UpdateReceiverInfoResult.MessageFailedAfterBasicInfoUpdated - } + return runCatchingCancellable { repository.updateReceiverMessage(receiverId, message) } + .fold( + onSuccess = { UpdateReceiverInfoResult.Success }, + onFailure = { UpdateReceiverInfoResult.MessageFailedAfterBasicInfoUpdated }, + ) } } diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/account/ConnectedAccountsViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/account/ConnectedAccountsViewModel.kt index 88d50b1263..6801c0e907 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/account/ConnectedAccountsViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/account/ConnectedAccountsViewModel.kt @@ -2,7 +2,7 @@ package com.afternote.feature.setting.presentation.account import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.user.UserConnectedAccount import com.afternote.feature.setting.domain.SettingAccountRepository import com.afternote.feature.setting.presentation.R diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/delivery/DeliveryConditionViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/delivery/DeliveryConditionViewModel.kt index d09b5a31ce..d0c0fad39d 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/delivery/DeliveryConditionViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/delivery/DeliveryConditionViewModel.kt @@ -1,8 +1,8 @@ package com.afternote.feature.setting.presentation.delivery import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.model.delivery.DeliveryConditionType import com.afternote.core.model.delivery.DeliveryContentType import com.afternote.core.model.delivery.InactivityPeriod diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/home/SettingViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/home/SettingViewModel.kt index e28c058206..6a461aa179 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/home/SettingViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/home/SettingViewModel.kt @@ -2,9 +2,9 @@ package com.afternote.feature.setting.presentation.home import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.MyProfileRepository import com.afternote.core.domain.repository.auth.AuthRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.setting.domain.SettingAccountRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CancellationException diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/notification/PushNotificationViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/notification/PushNotificationViewModel.kt index f55695787b..1b7e0b389f 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/notification/PushNotificationViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/notification/PushNotificationViewModel.kt @@ -6,8 +6,8 @@ import androidx.core.app.NotificationManagerCompat import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.error.PushSettingFailure +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.setting.domain.SettingNotificationRepository import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.qualifiers.ApplicationContext diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/profile/ProfileEditViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/profile/ProfileEditViewModel.kt index 3f9f300b93..fcf807dad2 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/profile/ProfileEditViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/profile/ProfileEditViewModel.kt @@ -1,8 +1,8 @@ package com.afternote.feature.setting.presentation.profile import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.MyProfileRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.ui.mvi.MviViewModel import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverEditViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverEditViewModel.kt index 33bbc3b172..5cf492243b 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverEditViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverEditViewModel.kt @@ -1,8 +1,8 @@ package com.afternote.feature.setting.presentation.receiver import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.ui.UiText import com.afternote.core.ui.mvi.MviViewModel import com.afternote.feature.setting.domain.UpdateReceiverInfoResult diff --git a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverRegisterViewModel.kt b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverRegisterViewModel.kt index 0fed507c84..6826cd64a6 100644 --- a/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverRegisterViewModel.kt +++ b/feature/setting/presentation/src/main/kotlin/com/afternote/feature/setting/presentation/receiver/ReceiverRegisterViewModel.kt @@ -2,8 +2,8 @@ package com.afternote.feature.setting.presentation.receiver import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.ui.UiText import com.afternote.feature.setting.presentation.R import dagger.hilt.android.lifecycle.HiltViewModel