From e9608878bc820d56c77b1fac8e67e177f555dfd6 Mon Sep 17 00:00:00 2001 From: jinukeu Date: Wed, 15 May 2024 15:05:21 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=EB=B3=B4=EB=82=B8=20=EB=B4=89?= =?UTF-8?q?=ED=88=AC=20->=20=ED=95=B4=EB=8B=B9=20=EB=B4=89=ED=88=AC=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/susu/feature/envelopeadd/EnvelopeAddContract.kt | 2 +- .../com/susu/feature/envelopeadd/EnvelopeAddViewModel.kt | 2 +- .../com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt | 4 ++-- .../java/com/susu/feature/sent/navigation/SentNavigation.kt | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddContract.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddContract.kt index 7282898f..d4f36245 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddContract.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddContract.kt @@ -5,7 +5,7 @@ import com.susu.core.ui.base.UiState sealed interface EnvelopeAddEffect : SideEffect { data object PopBackStack : EnvelopeAddEffect - data object PopBackStackWithRefresh : EnvelopeAddEffect + data class NavigateSentEnvelopeDetail(val id: Long) : EnvelopeAddEffect data class HandleException(val throwable: Throwable, val retry: () -> Unit) : EnvelopeAddEffect data class LogClickNextButton(val step: EnvelopeAddStep) : EnvelopeAddEffect data class LogClickBackButton(val step: EnvelopeAddStep) : EnvelopeAddEffect diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddViewModel.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddViewModel.kt index 21b6441d..c5613692 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddViewModel.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/EnvelopeAddViewModel.kt @@ -67,7 +67,7 @@ class EnvelopeAddViewModel @Inject constructor( category = category!!, ), ).onSuccess { - postSideEffect(EnvelopeAddEffect.PopBackStackWithRefresh) + postSideEffect(EnvelopeAddEffect.NavigateSentEnvelopeDetail(it.id)) }.onFailure { postSideEffect(EnvelopeAddEffect.HandleException(it, ::createEnvelope)) } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt index f1c9d41a..47117182 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -52,7 +52,7 @@ import java.time.LocalDateTime fun SentEnvelopeAddRoute( viewModel: EnvelopeAddViewModel = hiltViewModel(), popBackStack: () -> Unit, - popBackStackWithRefresh: () -> Unit, + navigateSentEnvelopeDetail: (Long) -> Unit, onShowSnackbar: (SnackbarToken) -> Unit, handleException: (Throwable, () -> Unit) -> Unit, ) { @@ -64,7 +64,7 @@ fun SentEnvelopeAddRoute( when (sideEffect) { is EnvelopeAddEffect.HandleException -> handleException(sideEffect.throwable, sideEffect.retry) EnvelopeAddEffect.PopBackStack -> popBackStack() - EnvelopeAddEffect.PopBackStackWithRefresh -> popBackStackWithRefresh() + is EnvelopeAddEffect.NavigateSentEnvelopeDetail -> navigateSentEnvelopeDetail(sideEffect.id) is EnvelopeAddEffect.LogClickBackButton -> scope.launch { FirebaseAnalytics.getInstance(context).logEvent( FirebaseAnalytics.Event.SELECT_CONTENT, diff --git a/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt b/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt index c7d2fc3f..1c05f9cd 100644 --- a/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt +++ b/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt @@ -139,7 +139,10 @@ fun NavGraphBuilder.sentNavGraph( composable(route = SentRoute.sentEnvelopeAddRoute("{${SentRoute.FRIEND_ARGUMENT_NAME}}")) { SentEnvelopeAddRoute( popBackStack = popBackStack, - popBackStackWithRefresh = popBackStackWithRefresh, + navigateSentEnvelopeDetail = { + popBackStackWithRefresh() + navigateSentEnvelopeDetail(it) + }, handleException = handleException, onShowSnackbar = onShowSnackbar, ) From 3c433a9029dd896f0b65ed46b37ae3b823260ada Mon Sep 17 00:00:00 2001 From: jinukeu Date: Wed, 15 May 2024 15:15:32 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=EB=B0=9B=EC=9D=80=20=EB=B4=89?= =?UTF-8?q?=ED=88=AC=20->=20=ED=95=B4=EB=8B=B9=20=EC=9E=A5=EB=B6=80=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../received/envelopeadd/ReceivedEnvelopeAddContract.kt | 4 +++- .../received/envelopeadd/ReceivedEnvelopeAddScreen.kt | 6 ++++-- .../received/envelopeadd/ReceivedEnvelopeAddViewModel.kt | 4 ++-- .../susu/feature/received/navigation/ReceivedNavigation.kt | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddContract.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddContract.kt index a0fda926..c0f66cb0 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddContract.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddContract.kt @@ -1,6 +1,8 @@ package com.susu.feature.received.envelopeadd import androidx.annotation.StringRes +import com.susu.core.model.Envelope +import com.susu.core.model.Ledger import com.susu.core.ui.base.SideEffect import com.susu.core.ui.base.UiState import com.susu.feature.received.R @@ -37,7 +39,7 @@ enum class EnvelopeAddStep( sealed interface ReceivedEnvelopeAddSideEffect : SideEffect { data class ShowSnackbar(val message: String) : ReceivedEnvelopeAddSideEffect data object PopBackStack : ReceivedEnvelopeAddSideEffect - data class PopBackStackWithEnvelope(val envelope: String) : ReceivedEnvelopeAddSideEffect + data class NavigateEnvelopeDetail(val envelope: Envelope, val ledger: Ledger) : ReceivedEnvelopeAddSideEffect data class HandleException(val throwable: Throwable, val retry: () -> Unit) : ReceivedEnvelopeAddSideEffect data class LogClickNextButton(val step: EnvelopeAddStep) : ReceivedEnvelopeAddSideEffect data class LogClickBackButton(val step: EnvelopeAddStep) : ReceivedEnvelopeAddSideEffect diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddScreen.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddScreen.kt index 833ce854..119a457d 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddScreen.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddScreen.kt @@ -29,6 +29,8 @@ import com.susu.core.designsystem.component.button.MediumButtonStyle import com.susu.core.designsystem.component.button.SusuFilledButton import com.susu.core.designsystem.component.screen.LoadingScreen import com.susu.core.designsystem.theme.SusuTheme +import com.susu.core.model.Envelope +import com.susu.core.model.Ledger import com.susu.core.model.Relationship import com.susu.core.ui.SnackbarToken import com.susu.core.ui.extension.collectWithLifecycle @@ -50,7 +52,7 @@ import java.time.LocalDateTime fun ReceivedEnvelopeAddRoute( viewModel: ReceivedEnvelopeAddViewModel = hiltViewModel(), popBackStack: () -> Unit, - popBackStackWithEnvelope: (String) -> Unit, + navigateEnvelopeDetail: (Envelope, Ledger) -> Unit, onShowSnackbar: (SnackbarToken) -> Unit, handleException: (Throwable, () -> Unit) -> Unit, ) { @@ -64,7 +66,7 @@ fun ReceivedEnvelopeAddRoute( is ReceivedEnvelopeAddSideEffect.HandleException -> handleException(sideEffect.throwable, sideEffect.retry) ReceivedEnvelopeAddSideEffect.PopBackStack -> popBackStack() is ReceivedEnvelopeAddSideEffect.ShowSnackbar -> onShowSnackbar(SnackbarToken(message = sideEffect.message)) - is ReceivedEnvelopeAddSideEffect.PopBackStackWithEnvelope -> popBackStackWithEnvelope(sideEffect.envelope) + is ReceivedEnvelopeAddSideEffect.NavigateEnvelopeDetail -> navigateEnvelopeDetail(sideEffect.envelope, sideEffect.ledger) is ReceivedEnvelopeAddSideEffect.LogClickBackButton -> scope.launch { FirebaseAnalytics.getInstance(context).logEvent( FirebaseAnalytics.Event.SELECT_CONTENT, diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt index 73a15ee4..0440a103 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt @@ -66,8 +66,8 @@ class ReceivedEnvelopeAddViewModel @Inject constructor( handedOverAt = date!!.toKotlinLocalDateTime(), hasVisited = hasVisited, ), - ).onSuccess { - postSideEffect(ReceivedEnvelopeAddSideEffect.PopBackStackWithEnvelope(Json.encodeToUri(it))) + ).onSuccess { envelope -> + postSideEffect(ReceivedEnvelopeAddSideEffect.NavigateEnvelopeDetail(envelope, ledger)) }.onFailure { throwable -> when (throwable) { is AlreadyRegisteredFriendPhoneNumberException -> postSideEffect(ReceivedEnvelopeAddSideEffect.ShowSnackbar(throwable.message)) diff --git a/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt b/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt index b8e7494a..8ac3299f 100644 --- a/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt +++ b/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt @@ -172,7 +172,10 @@ fun NavGraphBuilder.receivedNavGraph( ReceivedEnvelopeAddRoute( popBackStack = popBackStack, onShowSnackbar = onShowSnackbar, - popBackStackWithEnvelope = popBackStackWithEnvelope, + navigateEnvelopeDetail = { envelope, ledger -> + popBackStackWithEnvelope(Json.encodeToUri(envelope)) + navigateEnvelopeDetail(envelope, ledger) + }, handleException = handleException, ) } From a265cbd3521cee8bb3a140c22ae1c4d1181a6858 Mon Sep 17 00:00:00 2001 From: jinukeu Date: Wed, 15 May 2024 15:18:08 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=EB=B0=9B=EC=9D=80=20=EB=B4=89?= =?UTF-8?q?=ED=88=AC=20->=20=ED=95=B4=EB=8B=B9=20=EB=B4=89=ED=88=AC=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/susu/feature/received/ledgeradd/LedgerAddContract.kt | 3 ++- .../com/susu/feature/received/ledgeradd/LedgerAddScreen.kt | 5 +++-- .../susu/feature/received/ledgeradd/LedgerAddViewModel.kt | 2 +- .../susu/feature/received/navigation/ReceivedNavigation.kt | 5 ++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddContract.kt b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddContract.kt index 03285f54..1cf64df3 100644 --- a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddContract.kt +++ b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddContract.kt @@ -1,5 +1,6 @@ package com.susu.feature.received.ledgeradd +import com.susu.core.model.Ledger import com.susu.core.ui.base.SideEffect import com.susu.core.ui.base.UiState @@ -18,6 +19,6 @@ enum class LedgerAddStep { sealed interface LedgerAddSideEffect : SideEffect { data object HideKeyboard : LedgerAddSideEffect data object PopBackStack : LedgerAddSideEffect - data class PopBackStackWithLedger(val ledger: String) : LedgerAddSideEffect + data class NavigateLedgerDetail(val ledger: Ledger) : LedgerAddSideEffect data class HandleException(val throwable: Throwable, val retry: () -> Unit) : LedgerAddSideEffect } diff --git a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddScreen.kt b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddScreen.kt index 0d3067c1..8359a99d 100644 --- a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddScreen.kt +++ b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddScreen.kt @@ -27,6 +27,7 @@ import com.susu.core.designsystem.component.button.SusuFilledButton import com.susu.core.designsystem.component.screen.LoadingScreen import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.model.Category +import com.susu.core.model.Ledger import com.susu.core.ui.R import com.susu.core.ui.SnackbarToken import com.susu.core.ui.extension.collectWithLifecycle @@ -40,7 +41,7 @@ import java.time.LocalDateTime fun LedgerAddRoute( viewModel: LedgerAddViewModel = hiltViewModel(), popBackStack: () -> Unit, - popBackStackWithLedger: (String) -> Unit, + navigateLedgerDetail: (Ledger) -> Unit, onShowSnackbar: (SnackbarToken) -> Unit, handleException: (Throwable, () -> Unit) -> Unit, ) { @@ -50,7 +51,7 @@ fun LedgerAddRoute( when (sideEffect) { LedgerAddSideEffect.PopBackStack -> popBackStack() is LedgerAddSideEffect.HandleException -> handleException(sideEffect.throwable, sideEffect.retry) - is LedgerAddSideEffect.PopBackStackWithLedger -> popBackStackWithLedger(sideEffect.ledger) + is LedgerAddSideEffect.NavigateLedgerDetail -> navigateLedgerDetail(sideEffect.ledger) LedgerAddSideEffect.HideKeyboard -> keyboardController?.hide() } } diff --git a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt index 6438d499..124d7daa 100644 --- a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt @@ -80,7 +80,7 @@ class LedgerAddViewModel @Inject constructor( category = selectedCategory!!, ), ).onSuccess { ledger -> - postSideEffect(LedgerAddSideEffect.PopBackStackWithLedger(Json.encodeToUri(ledger))) + postSideEffect(LedgerAddSideEffect.NavigateLedgerDetail(ledger)) }.onFailure { postSideEffect(LedgerAddSideEffect.HandleException(it, ::createLedger)) } diff --git a/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt b/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt index 8ac3299f..130caaa9 100644 --- a/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt +++ b/feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt @@ -158,7 +158,10 @@ fun NavGraphBuilder.receivedNavGraph( ) { LedgerAddRoute( popBackStack = popBackStack, - popBackStackWithLedger = popBackStackWithLedger, + navigateLedgerDetail = { ledger -> + popBackStackWithLedger(Json.encodeToUri(ledger)) + navigateLedgerDetail(ledger) + }, handleException = handleException, onShowSnackbar = onShowSnackbar, ) From 1db85b0b3357d75494e069f95713debe5238da71 Mon Sep 17 00:00:00 2001 From: jinukeu Date: Wed, 15 May 2024 15:20:34 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=EB=82=A0=EC=A7=9C=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=20=EC=BF=BC=EB=A6=AC=20=EB=B3=80=EA=B2=BD=20(toEndAt?= =?UTF-8?q?=20->=20toStartAt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/susu/data/data/repository/LedgerRepositoryImpl.kt | 4 ++-- data/src/main/java/com/susu/data/remote/api/LedgerService.kt | 2 +- .../main/java/com/susu/domain/repository/LedgerRepository.kt | 2 +- .../com/susu/domain/usecase/ledger/GetLedgerListUseCase.kt | 4 ++-- .../received/envelopeadd/ReceivedEnvelopeAddViewModel.kt | 1 - .../com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt | 2 -- .../com/susu/feature/received/received/ReceivedViewModel.kt | 2 +- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/data/src/main/java/com/susu/data/data/repository/LedgerRepositoryImpl.kt b/data/src/main/java/com/susu/data/data/repository/LedgerRepositoryImpl.kt index 9ddf619e..79686a6c 100644 --- a/data/src/main/java/com/susu/data/data/repository/LedgerRepositoryImpl.kt +++ b/data/src/main/java/com/susu/data/data/repository/LedgerRepositoryImpl.kt @@ -16,14 +16,14 @@ class LedgerRepositoryImpl @Inject constructor( title: String?, categoryIdList: List?, fromStartAt: LocalDateTime, - toEndAt: LocalDateTime, + toStartAt: LocalDateTime, page: Int?, sort: String?, ): List = ledgerService.getLedgerList( title = title, categoryIdList = categoryIdList, fromStartAt = fromStartAt.toKotlinLocalDateTime(), - toEndAt = toEndAt.toKotlinLocalDateTime(), + toStartAt = toStartAt.toKotlinLocalDateTime(), page = page, sort = sort, ).getOrThrow().toModel() diff --git a/data/src/main/java/com/susu/data/remote/api/LedgerService.kt b/data/src/main/java/com/susu/data/remote/api/LedgerService.kt index ce901af2..0002b73c 100644 --- a/data/src/main/java/com/susu/data/remote/api/LedgerService.kt +++ b/data/src/main/java/com/susu/data/remote/api/LedgerService.kt @@ -20,7 +20,7 @@ interface LedgerService { @Query("title") title: String?, @Query("categoryIds") categoryIdList: List?, @Query("fromStartAt") fromStartAt: LocalDateTime, - @Query("toEndAt") toEndAt: LocalDateTime, + @Query("toStartAt") toStartAt: LocalDateTime, @Query("page") page: Int?, @Query("sort") sort: String?, ): ApiResult diff --git a/domain/src/main/java/com/susu/domain/repository/LedgerRepository.kt b/domain/src/main/java/com/susu/domain/repository/LedgerRepository.kt index 689bc5d2..969cce48 100644 --- a/domain/src/main/java/com/susu/domain/repository/LedgerRepository.kt +++ b/domain/src/main/java/com/susu/domain/repository/LedgerRepository.kt @@ -8,7 +8,7 @@ interface LedgerRepository { title: String?, categoryIdList: List?, fromStartAt: LocalDateTime, - toEndAt: LocalDateTime, + toStartAt: LocalDateTime, page: Int?, sort: String?, ): List diff --git a/domain/src/main/java/com/susu/domain/usecase/ledger/GetLedgerListUseCase.kt b/domain/src/main/java/com/susu/domain/usecase/ledger/GetLedgerListUseCase.kt index 4ec882b8..01f0b720 100644 --- a/domain/src/main/java/com/susu/domain/usecase/ledger/GetLedgerListUseCase.kt +++ b/domain/src/main/java/com/susu/domain/usecase/ledger/GetLedgerListUseCase.kt @@ -14,7 +14,7 @@ class GetLedgerListUseCase @Inject constructor( title = title, categoryIdList = categoryIdList, fromStartAt = fromStartAt ?: LocalDateTime.now().minusYears(100), - toEndAt = toEndAt ?: LocalDateTime.now().plusYears(100), + toStartAt = toStartAt ?: LocalDateTime.now().plusYears(100), page = page, sort = sort, ) @@ -25,7 +25,7 @@ class GetLedgerListUseCase @Inject constructor( val title: String? = null, val categoryIdList: List? = null, val fromStartAt: LocalDateTime? = null, - val toEndAt: LocalDateTime? = null, + val toStartAt: LocalDateTime? = null, val page: Int? = null, val sort: String? = null, ) diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt index 0440a103..90c8711e 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeadd/ReceivedEnvelopeAddViewModel.kt @@ -7,7 +7,6 @@ import com.susu.core.model.Relationship import com.susu.core.model.exception.AlreadyRegisteredFriendPhoneNumberException import com.susu.core.ui.base.BaseViewModel import com.susu.core.ui.extension.decodeFromUri -import com.susu.core.ui.extension.encodeToUri import com.susu.domain.usecase.envelope.CreateReceivedEnvelopeUseCase import com.susu.feature.received.navigation.ReceivedRoute import dagger.hilt.android.lifecycle.HiltViewModel diff --git a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt index 124d7daa..9859b867 100644 --- a/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddViewModel.kt @@ -4,13 +4,11 @@ import androidx.lifecycle.viewModelScope import com.susu.core.model.Category import com.susu.core.model.Ledger import com.susu.core.ui.base.BaseViewModel -import com.susu.core.ui.extension.encodeToUri import com.susu.domain.usecase.ledger.CreateLedgerUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.datetime.toKotlinLocalDateTime -import kotlinx.serialization.json.Json import java.time.LocalDateTime import javax.inject.Inject diff --git a/feature/received/src/main/java/com/susu/feature/received/received/ReceivedViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/received/ReceivedViewModel.kt index f19d72f6..68d5d29a 100644 --- a/feature/received/src/main/java/com/susu/feature/received/received/ReceivedViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/received/ReceivedViewModel.kt @@ -104,7 +104,7 @@ class ReceivedViewModel @Inject constructor( page = page, categoryIdList = filter.selectedCategoryList.map { it.id }, fromStartAt = currentState.startAt, - toEndAt = currentState.endAt, + toStartAt = currentState.endAt, sort = LedgerAlign.entries[currentState.selectedAlignPosition].query, ), ).onSuccess { ledgerList ->