Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ data class LedgerTransactionRequest(
val amount: Int,
val description: String,
val paymentDate: String,
val documentImageUrls: List<String> = emptyList()
val documentImageUrls: List<String> = emptyList(),
val category: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ data class LedgerTransactionDetailResponse(
val paymentDate: String,
val receiptImageUrls: List<ReceiptImageURL>,
val documentImageUrls: List<DocumentImageURL>,
val authorName: String
val authorName: String,
val category: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ fun LedgerScreen(
)
val analyticsTracker = LocalAnalyticsTracker.current

LaunchedEffect(Unit) {
viewModel.fetchMyAgencyList()
viewModel.fetchAgencyMemberList()
viewModel.fetchAgencyExistLedger()
LaunchedEffect(state.isStaff) {
println("isStaff: ${state.isStaff}")
Comment on lines +88 to +89
Copy link
Member

@jhg3410 jhg3410 Nov 4, 2025

Choose a reason for hiding this comment

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

디버깅 용도의 코드로 보이는데 따로 남겨두신 이유가 있을까요?? 없으시다면 제거해도 괜찮다 생각합니다!

}

viewModel.collectSideEffect {
when (it) {
is LedgerSideEffect.LedgerNavigateToLedgerDetail -> {
navigateToLedgerDetail(null, it.id, state.isStaff)
navigateToLedgerDetail(null, it.id, it.isStaff)
}

is LedgerSideEffect.LedgerNavigateToLedgerManual -> {
Expand Down Expand Up @@ -236,7 +234,8 @@ fun LedgerScreen(
onClickTransactionItem = {
viewModel.eventEmit(
LedgerSideEffect.LedgerNavigateToLedgerDetail(
it
id = it,
isStaff = state.isStaff,
)
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sealed class LedgerSideEffect : SideEffect {
data object LedgerCloseSheet : LedgerSideEffect()
data object LedgerNavigateToLedgerManual : LedgerSideEffect()
data object LedgerFetchRetry : LedgerSideEffect()
data class LedgerNavigateToLedgerDetail(val id: Int): LedgerSideEffect()
data class LedgerNavigateToLedgerDetail(val id: Int, val isStaff: Boolean): LedgerSideEffect()
data class LedgerSelectedAgencyChange(val agencyId: Int): LedgerSideEffect()
data class LedgerVisibleSnackbar(val message: String, val withDismissAction: Boolean): LedgerSideEffect()
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import com.moneymong.moneymong.design_system.component.button.MDSButtonSize
import com.moneymong.moneymong.design_system.component.button.MDSButtonType
import com.moneymong.moneymong.design_system.component.indicator.LoadingScreen
import com.moneymong.moneymong.design_system.component.modal.MDSModal
import com.moneymong.moneymong.design_system.component.tag.MDSOutlineTag
import com.moneymong.moneymong.design_system.component.textfield.MDSTextField
import com.moneymong.moneymong.design_system.component.textfield.util.MDSTextFieldIcons
import com.moneymong.moneymong.design_system.component.textfield.util.withRequiredMark
Expand Down Expand Up @@ -177,6 +178,36 @@ fun LedgerDetailScreen(
onClickDelete = { viewModel.onChangeVisibleConfirmModal(true) },
onClickDone = viewModel::onClickEditButton
)
},
bottomBar = {
if (state.isStaff) {
DisposableEffect(key1 = Unit) {
SystemBarColorController.setNavigationBarColor(color = White)

onDispose {
SystemBarColorController.initialSystemBarColors()
}
}

Column(
modifier = Modifier
.fillMaxWidth()
.background(White)
.padding(horizontal = MMHorizontalSpacing),
horizontalAlignment = Alignment.CenterHorizontally
) {
Spacer(modifier = Modifier.height(20.dp))
MDSButton(
modifier = Modifier.fillMaxWidth(),
text = "수정하기",
enabled = state.enabledEdit,
size = MDSButtonSize.LARGE,
type = MDSButtonType.PRIMARY,
onClick = viewModel::onClickEditButton
)
Spacer(modifier = Modifier.height(12.dp))
}
}
}
) {
Column(
Expand Down Expand Up @@ -384,6 +415,22 @@ fun LedgerDetailScreen(
.height(1.dp)
.background(Gray03, shape = DottedShape(8.dp))
)
Text(
text = "카테고리",
style = Body2,
color = Gray06
)
Spacer(modifier = Modifier.height(8.dp))
state.ledgerTransactionDetail?.category?.let {
MDSOutlineTag(text = it)
}
Box(
modifier = Modifier
.padding(vertical = 20.dp)
.fillMaxWidth()
.height(1.dp)
.background(Gray03, shape = DottedShape(8.dp))
)
Text(
text = "사진 첨부 (최대12장)",
style = Body2,
Expand Down Expand Up @@ -467,34 +514,6 @@ fun LedgerDetailScreen(
}
}
Spacer(modifier = Modifier.height(20.dp))
if (state.isStaff) {
DisposableEffect(key1 = Unit) {
SystemBarColorController.setNavigationBarColor(color = White)

onDispose {
SystemBarColorController.initialSystemBarColors()
}
}

Column(
modifier = Modifier
.fillMaxWidth()
.background(White)
.padding(horizontal = MMHorizontalSpacing),
horizontalAlignment = Alignment.CenterHorizontally
) {
Spacer(modifier = Modifier.height(20.dp))
MDSButton(
modifier = Modifier.fillMaxWidth(),
text = "수정하기",
enabled = state.enabledEdit,
size = MDSButtonSize.LARGE,
type = MDSButtonType.PRIMARY,
onClick = viewModel::onClickEditButton
)
Spacer(modifier = Modifier.height(12.dp))
}
}
}
if (state.isLoading) {
LoadingScreen(modifier = Modifier.fillMaxSize())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class LedgerDetailViewModel @Inject constructor(
reduce { state.copy(isStaff = isStaff) }
}

private fun showErrorDialog(message: String?) = intent {
private fun showErrorDialog(message: String?) = blockingIntent {
Copy link
Member

Choose a reason for hiding this comment

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

혹싀 blockingIntent로 변경된 이유는 어떤 걸까요??

reduce {
state.copy(
showErrorDialog = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class LedgerManualViewModel @Inject constructor(
description = state.memoValue.text.ifEmpty { "내용 없음" },
paymentDate = state.postPaymentDate,
documentImageUrls = state.documentList,
category = state.selectedCategory?.name,
)
postLedgerTransactionUseCase(state.agencyId, ledgerTransactionRequest)
.onSuccess {
Expand Down