Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mz 181 ledger filter #85

Merged
merged 15 commits into from
Jan 23, 2024
Merged

Feature/mz 181 ledger filter #85

merged 15 commits into from
Jan 23, 2024

Conversation

jinukeu
Copy link
Member

@jinukeu jinukeu commented Jan 22, 2024

💡 Issue

🌱 Key changes

  • 장부 필터 구현했습니다.

✅ To Reviewers

📸 스크린샷

KakaoTalk_Video_2024-01-22-15-18-01.mp4

@jinukeu jinukeu self-assigned this Jan 22, 2024
# Conflicts:
#	core/ui/src/main/res/values/strings.xml
#	feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt
#	feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt
#	feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt
#	feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt
#	feature/received/src/main/res/values/strings.xml
Copy link
Member

@yangsooplus yangsooplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아이고 확인이 늦어서 죄송합니다

Comment on lines +27 to +47
enum class LedgerAlign(
@StringRes val stringResId: Int,
val query: String,
) {
RECENT(
stringResId = R.string.word_align_recently,
query = "createdAt,desc",
),
OUTDATED(
stringResId = R.string.word_align_outdated,
query = "createdAt,asc",
),
HIGH_AMOUNT(
stringResId = R.string.word_align_high_amount,
query = "totalReceivedAmounts,desc",
),
LOW_AMOUNT(
stringResId = R.string.word_align_low_amount,
query = "totalReceivedAmounts,asc",
),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 받아요도 같은 정렬 기준을 사용하던데 ui 모듈로 옮기는건 어떤가요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query값이 조금 달라서 분리했어요!
받아요에서는 totalReceivedAmounts 이구 보내요에서는 totalSentAmounts 이에요!

val uiState = viewModel.uiState.collectAsStateWithLifecycle().value
viewModel.sideEffect.collectWithLifecycle { sideEffect ->
when (sideEffect) {
is LedgerFilterSideEffect.HandleException -> TODO()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 처리는 추후에 하시는 건가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헛 ... 아녀 지금 하겠습니다

}

fun getLedgerList(needClear: Boolean = false) = viewModelScope.launch {
mutex.withLock {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 작업에 mutex가 필요한 이유가 무엇인가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OnBottomReached이랑 Filter 과정 등 에서 getLedgerList 함수가 거의 동시에 실행되면서 race condition이 발생하더라구요 ㅜㅜ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아아 왜지 싶었는데 OnBottomReached 때에 호출되어서 그랬군요 그렇다면 좀 더 늦게 호출된 getLedgerList는 버려지나요? 혹은 먼저 실행된 getLedgerList를 기다렸다가 실행되는건가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기다렸다가 실행되어요!

@jinukeu jinukeu merged commit 9f5b51b into develop Jan 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] 장부 필터 서버 연동
2 participants