Add Income Feature#37
Open
dev-bilal-azzam wants to merge 23 commits into
Open
Conversation
# Conflicts: # composeApp/src/commonMain/kotlin/com/moneyplusplus/money/App.kt # composeApp/src/commonMain/kotlin/com/moneyplusplus/money/di/InitKoin.kt # data/src/commonMain/kotlin/com/moneyplusplus/data/di/RepositoryModule.kt # presentation/build.gradle.kts # presentation/src/commonMain/kotlin/com/moneyplusplus/presentation/di/ViewModelModule.kt
Comment on lines
+10
to
+31
| class AddIncome( | ||
| private val incomeRepository: IncomeRepository | ||
| ) { | ||
| suspend operator fun invoke(income: Income) { | ||
| println("Trace + Use case $income") | ||
| validateIncomeAmount(income.amount) | ||
| validateIncomeDate(income.date) | ||
| incomeRepository.addIncome(income) | ||
| } | ||
|
|
||
| private fun validateIncomeDate(date: LocalDate): Boolean { | ||
| return date <= LocalDate.currentDate() | ||
| } | ||
|
|
||
| private fun validateIncomeAmount(amount: Int): Boolean { | ||
| return amount > 0 | ||
| } | ||
|
|
||
| private fun LocalDate.Companion.currentDate(): LocalDate { | ||
| return Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date | ||
| } | ||
| } No newline at end of file |
Contributor
There was a problem hiding this comment.
this is a usecase right?, then add the postfix to the class name
| <key>CADisableMinimumFrameDurationOnPhone</key> | ||
| <true/> | ||
| <key>BASE_URL</key> | ||
| <string>https://money-plus-dev.vercel.app</string> |
Contributor
There was a problem hiding this comment.
find a way to not set the base url hard coded, cause we will have 2 apps, one for develop, and one for prod
Contributor
There was a problem hiding this comment.
you can take a look on the MENA project to check how did the infra team do this
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's New :
Demo :
Add.Income.Screen.Demo.webm