-
Notifications
You must be signed in to change notification settings - Fork 1
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 182 ledger add #79
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b5fd96e
feat: μ₯λΆ κ²μμ κΉλΉ‘μ΄λ νμ μ κ±°
jinukeu bd97ed1
feat: μ₯λΆ μΆκ° Parent Screen λμ ꡬν
jinukeu 45a3604
feat: μ₯λΆ μΆκ° μΉ΄ν
κ³ λ¦¬ μ ν λμ ꡬν
jinukeu 485e91b
feat: μ₯λΆ μΆκ° 컀μ€ν
μΉ΄ν
κ³ λ¦¬ λμ ꡬν
jinukeu 21c7eb2
feat: μ₯λΆ μΆκ° μ΄λ¦ μ
λ ₯ λμ ꡬν
jinukeu 21c1cbe
move: LedgerAddContent 리ν¨ν€μ§
jinukeu 93d0e93
feat: SusuLimitDatePickerBottomSheet -> initialCriteria Year, Month, β¦
jinukeu d289aa4
feat: μ₯λΆ μΆκ° λ μ§ μ ν λμ ꡬν
jinukeu a4daf57
feat: μ₯λΆ μΆκ° λ μ§ μ ν λμ ꡬν
jinukeu c045e60
feat: CreateLedgerUseCase μΆκ°
jinukeu 290efa4
feat: μ₯λΆ μΆκ° μλ² μ°λ
jinukeu ca2e11c
chore: ktlint, detekt
jinukeu 87dbc7f
Merge branch 'develop' into feature/MZ-182-ledger-add
jinukeu 2ae42b1
refactor: μ₯λΆ μμ± μ€κ³ λ³κ²½
jinukeu a9a7261
chore: μ£Όμ μ κ±°
jinukeu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
package com.susu.core.ui.util | ||
|
||
import android.util.Log | ||
import java.time.DateTimeException | ||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
val currentDate = LocalDateTime.now() | ||
val currentDate: LocalDateTime = LocalDateTime.now() | ||
val minDate: LocalDateTime = LocalDateTime.of(1930, 1, 1, 0, 0) | ||
|
||
@Suppress("detekt:FunctionNaming") | ||
fun LocalDateTime.to_yyyy_dot_MM_dot_dd(): String { | ||
val formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd") | ||
return this.format(formatter) | ||
} | ||
|
||
fun getSafeLocalDateTime(year: Int, month: Int, day: Int): LocalDateTime = try { | ||
LocalDateTime.of(year, month, day, 0, 0) | ||
} catch (e: DateTimeException) { | ||
Log.e("DateTimeError", "Invalid date provided: $year-$month-$day", e) | ||
LocalDateTime.of(year, month, 1, 0, 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
domain/src/main/java/com/susu/domain/usecase/ledger/CreateLedgerUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.susu.domain.usecase.ledger | ||
|
||
import com.susu.core.common.runCatchingIgnoreCancelled | ||
import com.susu.core.model.Ledger | ||
import com.susu.domain.repository.LedgerRepository | ||
import javax.inject.Inject | ||
|
||
class CreateLedgerUseCase @Inject constructor( | ||
private val ledgerRepository: LedgerRepository, | ||
) { | ||
suspend operator fun invoke(ledger: Ledger) = runCatchingIgnoreCancelled { | ||
ledgerRepository.createLedger(ledger) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
feature/received/src/main/java/com/susu/feature/received/ledgeradd/LedgerAddContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.susu.feature.received.ledgeradd | ||
|
||
import com.susu.core.ui.base.SideEffect | ||
import com.susu.core.ui.base.UiState | ||
|
||
data class LedgerAddState( | ||
val currentStep: LedgerAddStep = LedgerAddStep.CATEGORY, | ||
val buttonEnabled: Boolean = false, | ||
val isLoading: Boolean = false, | ||
) : UiState | ||
|
||
enum class LedgerAddStep { | ||
CATEGORY, | ||
NAME, | ||
DATE, | ||
} | ||
|
||
sealed interface LedgerAddSideEffect : SideEffect { | ||
data object PopBackStack : LedgerAddSideEffect | ||
data class PopBackStackWithLedger(val ledger: String) : LedgerAddSideEffect | ||
data class HandleException(val throwable: Throwable, val retry: () -> Unit) : LedgerAddSideEffect | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ°ν μνΈμμ 리μ€νΈμ 보μ΄λ λ μ§λ₯Ό λλ¬μλ μ νν μ μλλ‘ μμ ν΄μΌ ν κ² κ°λλΌκ³ μ..
νμ νΌμ³ λΉ¨λ λλ΄κ³ μΆκ°ν΄λ³΄λ €κ³ ν©λλ€~