generated from ajou4095/template-android
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
200 additions
and
255 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...n/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/GroupWithRelationDetail.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,9 @@ | ||
package ac.dnd.bookkeeping.android.domain.model.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail | ||
|
||
data class GroupWithRelationDetail( | ||
val id: Long, | ||
val name: String, | ||
val relationList: List<RelationDetail> | ||
) |
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
38 changes: 38 additions & 0 deletions
38
...in/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupHeartHistoryUseCase.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,38 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelationDetail | ||
import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail | ||
import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetailGroup | ||
import ac.dnd.bookkeeping.android.domain.usecase.feature.heart.GetHeartListUseCase | ||
import javax.inject.Inject | ||
|
||
class GetGroupHeartHistoryUseCase @Inject constructor( | ||
private val getHeartListUseCase: GetHeartListUseCase | ||
) { | ||
suspend operator fun invoke(): Result<List<GroupWithRelationDetail>> { | ||
return getHeartListUseCase("", "").map { heartList -> | ||
heartList.groupBy { heart -> | ||
heart.relation.group.id | ||
}.map { (key, heartList) -> | ||
val groupId = heartList.first().relation.group.id | ||
val groupName = heartList.first().relation.group.name | ||
GroupWithRelationDetail( | ||
id = groupId, | ||
name = groupName, | ||
relationList = heartList.map { heart -> | ||
RelationDetail( | ||
id = heart.relation.id, | ||
name = heart.relation.name, | ||
group = RelationDetailGroup( | ||
id = heart.relation.group.id, | ||
name = heart.relation.group.name | ||
), | ||
giveMoney = heart.giveHistories.sum(), | ||
takeMoney = heart.takeHistories.sum() | ||
) | ||
} | ||
) | ||
} | ||
} | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
.../group/GetGroupListWithRelationUseCase.kt → .../GetGroupListWithRelationSimpleUseCase.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
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
2 changes: 1 addition & 1 deletion
2
...tion/type/HistoryRegistrationEventType.kt → ...l/history/HistoryRegistrationEventType.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
2 changes: 1 addition & 1 deletion
2
...ration/type/HistoryRegistrationTagType.kt → ...del/history/HistoryRegistrationTagType.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
2 changes: 1 addition & 1 deletion
2
...istration/type/HistoryRegistrationType.kt → .../model/history/HistoryRegistrationType.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
2 changes: 1 addition & 1 deletion
2
...me/history/item/type/HistorySortedType.kt → ...tation/model/history/HistorySortedType.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
2 changes: 1 addition & 1 deletion
2
...home/history/item/type/HistoryViewType.kt → ...entation/model/history/HistoryViewType.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
2 changes: 1 addition & 1 deletion
2
...tration/calendar/HistoryCalendarScreen.kt → .../common/calendar/HistoryCalendarScreen.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
4 changes: 2 additions & 2 deletions
4
...dnd/bookkeeping/android/presentation/ui/main/home/common/relation/get/GetRelationModel.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.common.relation.get | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelation | ||
import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelationSimple | ||
import androidx.compose.runtime.Immutable | ||
|
||
@Immutable | ||
data class GetRelationModel( | ||
val state: GetRelationState, | ||
val groups: List<GroupWithRelation> | ||
val groups: List<GroupWithRelationSimple> | ||
) |
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
6 changes: 5 additions & 1 deletion
6
...main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/history/HistoryIntent.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.history | ||
|
||
sealed interface HistoryIntent | ||
import ac.dnd.bookkeeping.android.presentation.model.history.HistoryViewType | ||
|
||
sealed interface HistoryIntent { | ||
data class ClickTab(val type: HistoryViewType) : HistoryIntent | ||
} |
6 changes: 5 additions & 1 deletion
6
.../main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/history/HistoryModel.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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.history | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelationDetail | ||
import ac.dnd.bookkeeping.android.domain.model.legacy.HistoryInfoLegacy | ||
import ac.dnd.bookkeeping.android.presentation.model.history.HistoryViewType | ||
import androidx.compose.runtime.Immutable | ||
|
||
@Immutable | ||
data class HistoryModel( | ||
val state: HistoryState, | ||
val historyInfo: HistoryInfoLegacy | ||
val info: HistoryInfoLegacy, | ||
val viewType: HistoryViewType, | ||
val groups: List<GroupWithRelationDetail> | ||
) |
Oops, something went wrong.