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
35 changed files
with
504 additions
and
52 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...rc/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/AddGroupUseCase.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,16 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.GroupRepository | ||
import javax.inject.Inject | ||
|
||
class AddGroupUseCase @Inject constructor( | ||
private val groupRepository: GroupRepository | ||
) { | ||
suspend operator fun invoke( | ||
name: String | ||
): Result<Long> { | ||
return groupRepository.addGroup( | ||
name = name | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/DeleteGroupUseCase.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,16 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.GroupRepository | ||
import javax.inject.Inject | ||
|
||
class DeleteGroupUseCase @Inject constructor( | ||
private val groupRepository: GroupRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
): Result<Unit> { | ||
return groupRepository.deleteGroup( | ||
id = id | ||
) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...c/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/EditGroupUseCase.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,18 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.GroupRepository | ||
import javax.inject.Inject | ||
|
||
class EditGroupUseCase @Inject constructor( | ||
private val groupRepository: GroupRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
name: String | ||
): Result<Unit> { | ||
return groupRepository.editGroup( | ||
id = id, | ||
name = name | ||
) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ain/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListUseCase.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,13 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.group | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.group.Group | ||
import ac.dnd.bookkeeping.android.domain.repository.GroupRepository | ||
import javax.inject.Inject | ||
|
||
class GetGroupListUseCase @Inject constructor( | ||
private val groupRepository: GroupRepository | ||
) { | ||
suspend operator fun invoke(): Result<List<Group>> { | ||
return groupRepository.getGroupList() | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...rc/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/AddHeartUseCase.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,29 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import kotlinx.datetime.LocalDate | ||
import javax.inject.Inject | ||
|
||
class AddHeartUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
relationId: Long, | ||
give: Boolean, | ||
money: Long, | ||
day: LocalDate, | ||
event: String, | ||
memo: String, | ||
tags: List<String> | ||
): Result<Long> { | ||
return heartRepository.addHeart( | ||
relationId = relationId, | ||
give = give, | ||
money = money, | ||
day = day, | ||
event = event, | ||
memo = memo, | ||
tags = tags | ||
) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...tlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/AddUnrecordedHeartUseCase.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,20 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import javax.inject.Inject | ||
|
||
class AddUnrecordedHeartUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
scheduleId: Long, | ||
money: Long, | ||
tags: List<String> | ||
): Result<Long> { | ||
return heartRepository.addUnrecordedHeart( | ||
scheduleId = scheduleId, | ||
money = money, | ||
tags = tags | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/DeleteHeartUseCase.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,16 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import javax.inject.Inject | ||
|
||
class DeleteHeartUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
): Result<Unit> { | ||
return heartRepository.deleteHeart( | ||
id = id | ||
) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...c/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/EditHeartUseCase.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,27 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import kotlinx.datetime.LocalDate | ||
import javax.inject.Inject | ||
|
||
class EditHeartUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
money: Long, | ||
day: LocalDate, | ||
event: String, | ||
memo: String, | ||
tags: List<String> | ||
): Result<Unit> { | ||
return heartRepository.editHeart( | ||
id = id, | ||
money = money, | ||
day = day, | ||
event = event, | ||
memo = memo, | ||
tags = tags | ||
) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ain/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetHeartListUseCase.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,19 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.heart.Heart | ||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import javax.inject.Inject | ||
|
||
class GetHeartListUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
sort: String, | ||
name: String | ||
): Result<List<Heart>> { | ||
return heartRepository.getHeartList( | ||
sort = sort, | ||
name = name | ||
) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...lin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetRelatedHeartListUseCase.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,19 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.heart | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart | ||
import ac.dnd.bookkeeping.android.domain.repository.HeartRepository | ||
import javax.inject.Inject | ||
|
||
class GetRelatedHeartListUseCase @Inject constructor( | ||
private val heartRepository: HeartRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
sort: String | ||
): Result<List<RelatedHeart>> { | ||
return heartRepository.getRelatedHeartList( | ||
id = id, | ||
sort = sort | ||
) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...in/usecase/member/CheckNicknameUseCase.kt → ...se/feature/member/CheckNicknameUseCase.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
23 changes: 23 additions & 0 deletions
23
...ain/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/EditProfileUseCase.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,23 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.member | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.MemberRepository | ||
import kotlinx.datetime.LocalDate | ||
import javax.inject.Inject | ||
|
||
class EditProfileUseCase @Inject constructor( | ||
private val memberRepository: MemberRepository | ||
) { | ||
suspend operator fun invoke( | ||
profileImageUrl: String, | ||
nickname: String, | ||
gender: String, | ||
birth: LocalDate | ||
): Result<Unit> { | ||
return memberRepository.editProfile( | ||
profileImageUrl = profileImageUrl, | ||
nickname = nickname, | ||
gender = gender, | ||
birth = birth | ||
) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...n/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/AddRelationUseCase.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 ac.dnd.bookkeeping.android.domain.usecase.feature.relation | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.RelationRepository | ||
import javax.inject.Inject | ||
|
||
class AddRelationUseCase @Inject constructor( | ||
private val relationRepository: RelationRepository | ||
) { | ||
suspend operator fun invoke( | ||
groupId: Long, | ||
name: String, | ||
imageUrl: String, | ||
memo: String | ||
): Result<Long> { | ||
return relationRepository.addRelation( | ||
groupId = groupId, | ||
name = name, | ||
imageUrl = imageUrl, | ||
memo = memo | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...otlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/DeleteRelationUseCase.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,16 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.relation | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.RelationRepository | ||
import javax.inject.Inject | ||
|
||
class DeleteRelationUseCase @Inject constructor( | ||
private val relationRepository: RelationRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long | ||
): Result<Unit> { | ||
return relationRepository.deleteRelation( | ||
id = id | ||
) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
.../kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/EditRelationUseCase.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,24 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.relation | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.RelationRepository | ||
import javax.inject.Inject | ||
|
||
class EditRelationUseCase @Inject constructor( | ||
private val relationRepository: RelationRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long, | ||
groupId: Long, | ||
name: String, | ||
imageUrl: String, | ||
memo: String | ||
): Result<Unit> { | ||
return relationRepository.editRelation( | ||
id = id, | ||
groupId = groupId, | ||
name = name, | ||
imageUrl = imageUrl, | ||
memo = memo | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...tlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationListUseCase.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,17 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.relation | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple | ||
import ac.dnd.bookkeeping.android.domain.repository.RelationRepository | ||
import javax.inject.Inject | ||
|
||
class GetRelationListUseCase @Inject constructor( | ||
private val relationRepository: RelationRepository | ||
) { | ||
suspend operator fun invoke( | ||
name: String | ||
): Result<List<RelationSimple>> { | ||
return relationRepository.getRelationList( | ||
name = name | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...n/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationUseCase.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,17 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.relation | ||
|
||
import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail | ||
import ac.dnd.bookkeeping.android.domain.repository.RelationRepository | ||
import javax.inject.Inject | ||
|
||
class GetRelationUseCase @Inject constructor( | ||
private val relationRepository: RelationRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long | ||
): Result<RelationDetail> { | ||
return relationRepository.getRelation( | ||
id = id | ||
) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...n/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/AddScheduleUseCase.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,37 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.schedule | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.ScheduleRepository | ||
import kotlinx.datetime.LocalDate | ||
import kotlinx.datetime.LocalDateTime | ||
import kotlinx.datetime.LocalTime | ||
import javax.inject.Inject | ||
|
||
class AddScheduleUseCase @Inject constructor( | ||
private val scheduleRepository: ScheduleRepository | ||
) { | ||
suspend operator fun invoke( | ||
relationId: Long, | ||
day: LocalDate, | ||
event: String, | ||
repeatType: String, | ||
repeatFinish: LocalDate, | ||
alarm: LocalDateTime, | ||
time: LocalTime, | ||
link: String, | ||
location: String, | ||
memo: String | ||
): Result<Long> { | ||
return scheduleRepository.addSchedule( | ||
relationId = relationId, | ||
day = day, | ||
event = event, | ||
repeatType = repeatType, | ||
repeatFinish = repeatFinish, | ||
alarm = alarm, | ||
time = time, | ||
link = link, | ||
location = location, | ||
memo = memo | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...otlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/DeleteScheduleUseCase.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,16 @@ | ||
package ac.dnd.bookkeeping.android.domain.usecase.feature.schedule | ||
|
||
import ac.dnd.bookkeeping.android.domain.repository.ScheduleRepository | ||
import javax.inject.Inject | ||
|
||
class DeleteScheduleUseCase @Inject constructor( | ||
private val scheduleRepository: ScheduleRepository | ||
) { | ||
suspend operator fun invoke( | ||
id: Long | ||
): Result<Unit> { | ||
return scheduleRepository.deleteSchedule( | ||
id = id | ||
) | ||
} | ||
} |
Oops, something went wrong.