Skip to content

Commit

Permalink
feat: 날짜 필터 쿼리 변경 (toEndAt -> toStartAt)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed May 15, 2024
1 parent a265cbd commit 1db85b0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class LedgerRepositoryImpl @Inject constructor(
title: String?,
categoryIdList: List<Int>?,
fromStartAt: LocalDateTime,
toEndAt: LocalDateTime,
toStartAt: LocalDateTime,
page: Int?,
sort: String?,
): List<Ledger> = ledgerService.getLedgerList(
title = title,
categoryIdList = categoryIdList,
fromStartAt = fromStartAt.toKotlinLocalDateTime(),
toEndAt = toEndAt.toKotlinLocalDateTime(),
toStartAt = toStartAt.toKotlinLocalDateTime(),
page = page,
sort = sort,
).getOrThrow().toModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface LedgerService {
@Query("title") title: String?,
@Query("categoryIds") categoryIdList: List<Int>?,
@Query("fromStartAt") fromStartAt: LocalDateTime,
@Query("toEndAt") toEndAt: LocalDateTime,
@Query("toStartAt") toStartAt: LocalDateTime,
@Query("page") page: Int?,
@Query("sort") sort: String?,
): ApiResult<LedgerListResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface LedgerRepository {
title: String?,
categoryIdList: List<Int>?,
fromStartAt: LocalDateTime,
toEndAt: LocalDateTime,
toStartAt: LocalDateTime,
page: Int?,
sort: String?,
): List<Ledger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -25,7 +25,7 @@ class GetLedgerListUseCase @Inject constructor(
val title: String? = null,
val categoryIdList: List<Int>? = null,
val fromStartAt: LocalDateTime? = null,
val toEndAt: LocalDateTime? = null,
val toStartAt: LocalDateTime? = null,
val page: Int? = null,
val sort: String? = null,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 1db85b0

Please sign in to comment.