From 4c67aa400d56e3130b3041b620cbb31ff7090ac4 Mon Sep 17 00:00:00 2001 From: Ray Jang <48707913+ajou4095@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:45:25 +0900 Subject: [PATCH] =?UTF-8?q?[Feature]=20=EC=A4=91=EC=B2=A9=20UseCase=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/data/di/RepositoryModule.kt | 12 ++-- .../data/remote/network/api/HeartApi.kt | 8 +-- .../data/remote/network/api/RelationApi.kt | 6 +- .../data/remote/network/api/ScheduleApi.kt | 6 +- .../network/model/group/GetGroupListRes.kt | 2 +- .../network/model/heart/GetHeartListRes.kt | 4 +- .../model/heart/GetRelatedHeartListRes.kt | 2 +- .../model/relation/GetRelationListRes.kt | 4 +- .../network/model/relation/GetRelationRes.kt | 4 +- .../schedule/GetUnrecordedScheduleListRes.kt | 4 +- .../model/statistics/GetGroupStatisticsRes.kt | 2 +- .../model/statistics/GetMyStatisticsRes.kt | 8 +-- .../sociallogin/KakaoLoginRepositoryImpl.kt | 4 +- .../group/MockGroupRepository.kt | 4 +- .../group/RealGroupRepository.kt | 4 +- .../heart/MockHeartRepository.kt | 8 +-- .../heart/RealHeartRepository.kt | 8 +-- .../relation/MockRelationRepository.kt | 10 +-- .../relation/RealRelationRepository.kt | 8 +-- .../schedule/MockScheduleRepository.kt | 6 +- .../schedule/RealScheduleRepository.kt | 6 +- .../statistics/MockStatisticsRepository.kt | 12 ++-- .../statistics/RealStatisticsRepository.kt | 8 +-- .../sociallogin/KakaoUserInformation.kt | 2 +- .../domain/model/feature/group/Group.kt | 6 ++ .../model/feature/group/GroupWithRelation.kt | 9 +++ .../domain/model/{ => feature}/heart/Heart.kt | 2 +- .../model/{ => feature}/heart/RelatedHeart.kt | 2 +- .../{ => feature}/relation/RelationDetail.kt | 2 +- .../{ => feature}/relation/RelationSimple.kt | 2 +- .../schedule/UnrecordedSchedule.kt | 2 +- .../statistics/GroupStatistics.kt | 2 +- .../{ => feature}/statistics/MyStatistics.kt | 2 +- .../android/domain/model/group/Group.kt | 6 -- .../domain/repository/GroupRepository.kt | 2 +- .../domain/repository/HeartRepository.kt | 12 ++-- .../domain/repository/KakaoLoginRepository.kt | 2 +- .../domain/repository/RelationRepository.kt | 10 +-- .../domain/repository/ScheduleRepository.kt | 8 +-- .../domain/repository/StatisticsRepository.kt | 4 +- .../sociallogin/GetKakaoUserInfoUseCase.kt | 2 +- .../feature/group/GetGroupListUseCase.kt | 2 +- .../group/GetGroupListWithRelationUseCase.kt | 24 +++++++ .../feature/heart/GetHeartListUseCase.kt | 2 +- .../heart/GetRelatedHeartListUseCase.kt | 2 +- .../relation/EditRelationWithUploadUseCase.kt | 31 ++++++++ .../relation/GetRelationListUseCase.kt | 2 +- .../feature/relation/GetRelationUseCase.kt | 2 +- .../GetUnrecordedScheduleListUseCase.kt | 2 +- .../statistics/GetGroupStatisticsUseCase.kt | 2 +- .../statistics/GetMyStatisticsUseCase.kt | 2 +- .../file/GetUrlAndUploadImageUseCase.kt | 24 +++++++ .../usecase/legacy/GetGroupListUseCase.kt | 71 ------------------- .../member/CheckNicknameUseCase.kt | 2 +- .../member/EditProfileUseCase.kt | 2 +- .../member/EditProfileWithUploadUseCase.kt | 30 ++++++++ .../model/login/KakaoUserInformationModel.kt | 2 +- .../common/relation/SearchRelationModel.kt | 4 +- .../common/relation/SearchRelationScreen.kt | 30 ++++---- .../relation/SearchRelationViewModel.kt | 14 ++-- .../main/RegistrationMainViewModel.kt | 2 +- 61 files changed, 257 insertions(+), 212 deletions(-) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => authentication}/sociallogin/KakaoLoginRepositoryImpl.kt (96%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/group/MockGroupRepository.kt (91%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/group/RealGroupRepository.kt (89%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/heart/MockHeartRepository.kt (94%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/heart/RealHeartRepository.kt (89%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/relation/MockRelationRepository.kt (86%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/relation/RealRelationRepository.kt (85%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/schedule/MockScheduleRepository.kt (90%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/schedule/RealScheduleRepository.kt (91%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/statistics/MockStatisticsRepository.kt (83%) rename data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/{ => feature}/statistics/RealStatisticsRepository.kt (78%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => authentication}/sociallogin/KakaoUserInformation.kt (64%) create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/Group.kt create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/GroupWithRelation.kt rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/heart/Heart.kt (81%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/heart/RelatedHeart.kt (78%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/relation/RelationDetail.kt (77%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/relation/RelationSimple.kt (73%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/schedule/UnrecordedSchedule.kt (87%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/statistics/GroupStatistics.kt (70%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/{ => feature}/statistics/MyStatistics.kt (85%) delete mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/group/Group.kt create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListWithRelationUseCase.kt create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/EditRelationWithUploadUseCase.kt create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/file/GetUrlAndUploadImageUseCase.kt delete mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/legacy/GetGroupListUseCase.kt rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/{feature => }/member/CheckNicknameUseCase.kt (85%) rename domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/{feature => }/member/EditProfileUseCase.kt (90%) create mode 100644 domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileWithUploadUseCase.kt diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/di/RepositoryModule.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/di/RepositoryModule.kt index 075f8d6d..5d00e315 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/di/RepositoryModule.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/di/RepositoryModule.kt @@ -2,13 +2,13 @@ package ac.dnd.bookkeeping.android.data.di import ac.dnd.bookkeeping.android.data.repository.authentication.MockAuthenticationRepository import ac.dnd.bookkeeping.android.data.repository.file.MockFileRepository -import ac.dnd.bookkeeping.android.data.repository.group.MockGroupRepository -import ac.dnd.bookkeeping.android.data.repository.heart.MockHeartRepository +import ac.dnd.bookkeeping.android.data.repository.feature.group.MockGroupRepository +import ac.dnd.bookkeeping.android.data.repository.feature.heart.MockHeartRepository import ac.dnd.bookkeeping.android.data.repository.member.MockMemberRepository -import ac.dnd.bookkeeping.android.data.repository.relation.MockRelationRepository -import ac.dnd.bookkeeping.android.data.repository.schedule.MockScheduleRepository -import ac.dnd.bookkeeping.android.data.repository.sociallogin.KakaoLoginRepositoryImpl -import ac.dnd.bookkeeping.android.data.repository.statistics.MockStatisticsRepository +import ac.dnd.bookkeeping.android.data.repository.feature.relation.MockRelationRepository +import ac.dnd.bookkeeping.android.data.repository.feature.schedule.MockScheduleRepository +import ac.dnd.bookkeeping.android.data.repository.authentication.sociallogin.KakaoLoginRepositoryImpl +import ac.dnd.bookkeeping.android.data.repository.feature.statistics.MockStatisticsRepository import ac.dnd.bookkeeping.android.domain.repository.AuthenticationRepository import ac.dnd.bookkeeping.android.domain.repository.FileRepository import ac.dnd.bookkeeping.android.domain.repository.GroupRepository diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/HeartApi.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/HeartApi.kt index 3633efb3..505b2416 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/HeartApi.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/HeartApi.kt @@ -58,7 +58,7 @@ class HeartApi @Inject constructor( money: Long, day: LocalDate, event: String, - memo: String = "", + memo: String, tags: List ): Result { return client.patch("$baseUrl/api/v1/hearts/$id") { @@ -98,8 +98,8 @@ class HeartApi @Inject constructor( } suspend fun getHeartList( - sort: String = "recent", - name: String = "" + sort: String, + name: String ): Result { return client.get("$baseUrl/api/v1/hearts/me") { parameter("sort", sort) // recent, intimacy @@ -109,7 +109,7 @@ class HeartApi @Inject constructor( suspend fun getRelatedHeartList( id: Long, - sort: String = "recent" + sort: String ): Result { return client.get("$baseUrl/api/v1/hearts/me/$id") { parameter("sort", sort) // recent, old diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/RelationApi.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/RelationApi.kt index 59243e93..db64107e 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/RelationApi.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/RelationApi.kt @@ -30,7 +30,7 @@ class RelationApi @Inject constructor( groupId: Long, name: String, imageUrl: String, - memo: String = "" + memo: String ): Result { return client.post("$baseUrl/api/v1/relations") { setBody( @@ -49,7 +49,7 @@ class RelationApi @Inject constructor( groupId: Long, name: String, imageUrl: String, - memo: String = "" + memo: String ): Result { return client.patch("$baseUrl/api/v1/relations/$id") { setBody( @@ -78,7 +78,7 @@ class RelationApi @Inject constructor( } suspend fun getRelationList( - name: String = "" + name: String ): Result { return client.get("$baseUrl/api/v1/relations/me") { parameter("name", name) diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/ScheduleApi.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/ScheduleApi.kt index 61975932..3ea04de0 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/ScheduleApi.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/api/ScheduleApi.kt @@ -38,7 +38,7 @@ class ScheduleApi @Inject constructor( time: LocalTime, link: String, location: String, - memo: String = "", + memo: String ): Result { return client.post("$baseUrl/api/v1/schedules") { setBody( @@ -69,7 +69,7 @@ class ScheduleApi @Inject constructor( time: LocalTime, link: String, location: String, - memo: String = "", + memo: String ): Result { return client.patch("$baseUrl/api/v1/schedules/$id") { setBody( @@ -97,7 +97,7 @@ class ScheduleApi @Inject constructor( } suspend fun getUnrecordedScheduleList( - name: String = "" + name: String ): Result { return client.get("$baseUrl/api/v1/schedules/unrecorded") { parameter("name", name) diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/group/GetGroupListRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/group/GetGroupListRes.kt index 34f30e08..1d88cf64 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/group/GetGroupListRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/group/GetGroupListRes.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.group import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetHeartListRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetHeartListRes.kt index 91fbbb23..cef83f4c 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetHeartListRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetHeartListRes.kt @@ -1,8 +1,8 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.heart import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.heart.Heart -import ac.dnd.bookkeeping.android.domain.model.heart.HeartGroup +import ac.dnd.bookkeeping.android.domain.model.feature.heart.Heart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.HeartGroup import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetRelatedHeartListRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetRelatedHeartListRes.kt index 005a3e21..af85026a 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetRelatedHeartListRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/heart/GetRelatedHeartListRes.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.heart import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart import kotlinx.datetime.LocalDate import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationListRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationListRes.kt index 7f834279..3ad09437 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationListRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationListRes.kt @@ -1,8 +1,8 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.relation import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimpleGroup +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimpleGroup import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationRes.kt index 4a6f1077..389374cb 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/relation/GetRelationRes.kt @@ -1,8 +1,8 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.relation import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetailGroup +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetailGroup import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/schedule/GetUnrecordedScheduleListRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/schedule/GetUnrecordedScheduleListRes.kt index 8450bf15..be2fa8a8 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/schedule/GetUnrecordedScheduleListRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/schedule/GetUnrecordedScheduleListRes.kt @@ -1,8 +1,8 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.schedule import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedSchedule -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedScheduleRelation +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedSchedule +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedScheduleRelation import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalTime diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetGroupStatisticsRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetGroupStatisticsRes.kt index 0fb6382f..cb3f4083 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetGroupStatisticsRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetGroupStatisticsRes.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.statistics import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.statistics.GroupStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.GroupStatistics import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetMyStatisticsRes.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetMyStatisticsRes.kt index 55fd9f54..25403be5 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetMyStatisticsRes.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/remote/network/model/statistics/GetMyStatisticsRes.kt @@ -1,10 +1,10 @@ package ac.dnd.bookkeeping.android.data.remote.network.model.statistics import ac.dnd.bookkeeping.android.data.remote.mapper.DataMapper -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsEvent -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsGive -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsTake +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsEvent +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsGive +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsTake import kotlinx.datetime.LocalDate import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/sociallogin/KakaoLoginRepositoryImpl.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/authentication/sociallogin/KakaoLoginRepositoryImpl.kt similarity index 96% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/sociallogin/KakaoLoginRepositoryImpl.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/authentication/sociallogin/KakaoLoginRepositoryImpl.kt index 1fd1e66d..055c52aa 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/sociallogin/KakaoLoginRepositoryImpl.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/authentication/sociallogin/KakaoLoginRepositoryImpl.kt @@ -1,7 +1,7 @@ -package ac.dnd.bookkeeping.android.data.repository.sociallogin +package ac.dnd.bookkeeping.android.data.repository.authentication.sociallogin import ac.dnd.bookkeeping.android.domain.model.error.ServerException -import ac.dnd.bookkeeping.android.domain.model.sociallogin.KakaoUserInformation +import ac.dnd.bookkeeping.android.domain.model.authentication.sociallogin.KakaoUserInformation import ac.dnd.bookkeeping.android.domain.repository.KakaoLoginRepository import android.content.Context import com.kakao.sdk.common.model.ClientError diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/MockGroupRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/MockGroupRepository.kt similarity index 91% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/MockGroupRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/MockGroupRepository.kt index ee018a17..10a90710 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/MockGroupRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/MockGroupRepository.kt @@ -1,6 +1,6 @@ -package ac.dnd.bookkeeping.android.data.repository.group +package ac.dnd.bookkeeping.android.data.repository.feature.group -import ac.dnd.bookkeeping.android.domain.model.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import kotlinx.coroutines.delay import javax.inject.Inject diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/RealGroupRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/RealGroupRepository.kt similarity index 89% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/RealGroupRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/RealGroupRepository.kt index 97311240..0c628d0f 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/group/RealGroupRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/group/RealGroupRepository.kt @@ -1,9 +1,9 @@ -package ac.dnd.bookkeeping.android.data.repository.group +package ac.dnd.bookkeeping.android.data.repository.feature.group import ac.dnd.bookkeeping.android.data.remote.local.SharedPreferencesManager import ac.dnd.bookkeeping.android.data.remote.network.api.GroupApi import ac.dnd.bookkeeping.android.data.remote.network.util.toDomain -import ac.dnd.bookkeeping.android.domain.model.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import javax.inject.Inject diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/MockHeartRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/MockHeartRepository.kt similarity index 94% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/MockHeartRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/MockHeartRepository.kt index 14ea6f35..22cf2905 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/MockHeartRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/MockHeartRepository.kt @@ -1,8 +1,8 @@ -package ac.dnd.bookkeeping.android.data.repository.heart +package ac.dnd.bookkeeping.android.data.repository.feature.heart -import ac.dnd.bookkeeping.android.domain.model.heart.Heart -import ac.dnd.bookkeeping.android.domain.model.heart.HeartGroup -import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.Heart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.HeartGroup +import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart import ac.dnd.bookkeeping.android.domain.repository.HeartRepository import kotlinx.coroutines.delay import kotlinx.datetime.LocalDate diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/RealHeartRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/RealHeartRepository.kt similarity index 89% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/RealHeartRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/RealHeartRepository.kt index 2a402bc8..85e9a6e4 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/heart/RealHeartRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/heart/RealHeartRepository.kt @@ -1,11 +1,11 @@ -package ac.dnd.bookkeeping.android.data.repository.heart +package ac.dnd.bookkeeping.android.data.repository.feature.heart import ac.dnd.bookkeeping.android.data.remote.local.SharedPreferencesManager import ac.dnd.bookkeeping.android.data.remote.network.api.HeartApi import ac.dnd.bookkeeping.android.data.remote.network.util.toDomain -import ac.dnd.bookkeeping.android.domain.model.group.Group -import ac.dnd.bookkeeping.android.domain.model.heart.Heart -import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.heart.Heart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import ac.dnd.bookkeeping.android.domain.repository.HeartRepository import kotlinx.datetime.LocalDate diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/MockRelationRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/MockRelationRepository.kt similarity index 86% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/MockRelationRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/MockRelationRepository.kt index 1104d0ac..826c03b3 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/MockRelationRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/MockRelationRepository.kt @@ -1,9 +1,9 @@ -package ac.dnd.bookkeeping.android.data.repository.relation +package ac.dnd.bookkeeping.android.data.repository.feature.relation -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetailGroup -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimpleGroup +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.model.feature.relation.RelationSimple +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimpleGroup import ac.dnd.bookkeeping.android.domain.repository.RelationRepository import kotlinx.coroutines.delay import javax.inject.Inject diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/RealRelationRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/RealRelationRepository.kt similarity index 85% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/RealRelationRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/RealRelationRepository.kt index dc4cfa91..e7b7f5b7 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/relation/RealRelationRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/relation/RealRelationRepository.kt @@ -1,11 +1,11 @@ -package ac.dnd.bookkeeping.android.data.repository.relation +package ac.dnd.bookkeeping.android.data.repository.feature.relation import ac.dnd.bookkeeping.android.data.remote.local.SharedPreferencesManager import ac.dnd.bookkeeping.android.data.remote.network.api.RelationApi import ac.dnd.bookkeeping.android.data.remote.network.util.toDomain -import ac.dnd.bookkeeping.android.domain.model.group.Group -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import ac.dnd.bookkeeping.android.domain.repository.RelationRepository import javax.inject.Inject diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/MockScheduleRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/MockScheduleRepository.kt similarity index 90% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/MockScheduleRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/MockScheduleRepository.kt index 757f0664..c28572bc 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/MockScheduleRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/MockScheduleRepository.kt @@ -1,7 +1,7 @@ -package ac.dnd.bookkeeping.android.data.repository.schedule +package ac.dnd.bookkeeping.android.data.repository.feature.schedule -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedSchedule -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedScheduleRelation +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedSchedule +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedScheduleRelation import ac.dnd.bookkeeping.android.domain.repository.ScheduleRepository import kotlinx.coroutines.delay import kotlinx.datetime.LocalDate diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/RealScheduleRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/RealScheduleRepository.kt similarity index 91% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/RealScheduleRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/RealScheduleRepository.kt index 3fa718f5..1ac5ee8a 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/schedule/RealScheduleRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/schedule/RealScheduleRepository.kt @@ -1,10 +1,10 @@ -package ac.dnd.bookkeeping.android.data.repository.schedule +package ac.dnd.bookkeeping.android.data.repository.feature.schedule import ac.dnd.bookkeeping.android.data.remote.local.SharedPreferencesManager import ac.dnd.bookkeeping.android.data.remote.network.api.ScheduleApi import ac.dnd.bookkeeping.android.data.remote.network.util.toDomain -import ac.dnd.bookkeeping.android.domain.model.group.Group -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedSchedule +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedSchedule import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import ac.dnd.bookkeeping.android.domain.repository.ScheduleRepository import kotlinx.datetime.LocalDate diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/MockStatisticsRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/MockStatisticsRepository.kt similarity index 83% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/MockStatisticsRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/MockStatisticsRepository.kt index b97009bf..2e8762a9 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/MockStatisticsRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/MockStatisticsRepository.kt @@ -1,10 +1,10 @@ -package ac.dnd.bookkeeping.android.data.repository.statistics +package ac.dnd.bookkeeping.android.data.repository.feature.statistics -import ac.dnd.bookkeeping.android.domain.model.statistics.GroupStatistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsEvent -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsGive -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatisticsTake +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.GroupStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsEvent +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsGive +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatisticsTake import ac.dnd.bookkeeping.android.domain.repository.StatisticsRepository import kotlinx.coroutines.delay import kotlinx.datetime.LocalDate diff --git a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/RealStatisticsRepository.kt b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/RealStatisticsRepository.kt similarity index 78% rename from data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/RealStatisticsRepository.kt rename to data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/RealStatisticsRepository.kt index 97e920f2..575b99da 100644 --- a/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/statistics/RealStatisticsRepository.kt +++ b/data/src/main/kotlin/ac/dnd/bookkeeping/android/data/repository/feature/statistics/RealStatisticsRepository.kt @@ -1,11 +1,11 @@ -package ac.dnd.bookkeeping.android.data.repository.statistics +package ac.dnd.bookkeeping.android.data.repository.feature.statistics import ac.dnd.bookkeeping.android.data.remote.local.SharedPreferencesManager import ac.dnd.bookkeeping.android.data.remote.network.api.StatisticsApi import ac.dnd.bookkeeping.android.data.remote.network.util.toDomain -import ac.dnd.bookkeeping.android.domain.model.group.Group -import ac.dnd.bookkeeping.android.domain.model.statistics.GroupStatistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.GroupStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatistics import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import ac.dnd.bookkeeping.android.domain.repository.StatisticsRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/sociallogin/KakaoUserInformation.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/authentication/sociallogin/KakaoUserInformation.kt similarity index 64% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/sociallogin/KakaoUserInformation.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/authentication/sociallogin/KakaoUserInformation.kt index 3dc9116f..205aa868 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/sociallogin/KakaoUserInformation.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/authentication/sociallogin/KakaoUserInformation.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.sociallogin +package ac.dnd.bookkeeping.android.domain.model.authentication.sociallogin data class KakaoUserInformation( val socialId: Long, diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/Group.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/Group.kt new file mode 100644 index 00000000..d43c9e81 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/Group.kt @@ -0,0 +1,6 @@ +package ac.dnd.bookkeeping.android.domain.model.feature.group + +data class Group( + val id: Long, + val name: String +) diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/GroupWithRelation.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/GroupWithRelation.kt new file mode 100644 index 00000000..871b9fa0 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/group/GroupWithRelation.kt @@ -0,0 +1,9 @@ +package ac.dnd.bookkeeping.android.domain.model.feature.group + +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple + +data class GroupWithRelation( + val id: Long, + val name: String, + val relationList: List +) diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/Heart.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/Heart.kt similarity index 81% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/Heart.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/Heart.kt index 4feecd2d..82977f1e 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/Heart.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/Heart.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.heart +package ac.dnd.bookkeeping.android.domain.model.feature.heart data class Heart( val id: Long, diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/RelatedHeart.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/RelatedHeart.kt similarity index 78% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/RelatedHeart.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/RelatedHeart.kt index 7b70c5b9..98ded71d 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/heart/RelatedHeart.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/heart/RelatedHeart.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.heart +package ac.dnd.bookkeeping.android.domain.model.feature.heart import kotlinx.datetime.LocalDate diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationDetail.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationDetail.kt similarity index 77% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationDetail.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationDetail.kt index 0afc7770..42b43e76 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationDetail.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationDetail.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.relation +package ac.dnd.bookkeeping.android.domain.model.feature.relation data class RelationDetail( val id: Long, diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationSimple.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationSimple.kt similarity index 73% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationSimple.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationSimple.kt index a15ce3e2..70c52099 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/relation/RelationSimple.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/relation/RelationSimple.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.relation +package ac.dnd.bookkeeping.android.domain.model.feature.relation data class RelationSimple( val id: Long, diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/schedule/UnrecordedSchedule.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/schedule/UnrecordedSchedule.kt similarity index 87% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/schedule/UnrecordedSchedule.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/schedule/UnrecordedSchedule.kt index 766a9d88..e74d6252 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/schedule/UnrecordedSchedule.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/schedule/UnrecordedSchedule.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.schedule +package ac.dnd.bookkeeping.android.domain.model.feature.schedule import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/GroupStatistics.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/GroupStatistics.kt similarity index 70% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/GroupStatistics.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/GroupStatistics.kt index 59a804a7..c6708189 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/GroupStatistics.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/GroupStatistics.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.statistics +package ac.dnd.bookkeeping.android.domain.model.feature.statistics data class GroupStatistics( val marriage: Long, diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/MyStatistics.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/MyStatistics.kt similarity index 85% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/MyStatistics.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/MyStatistics.kt index a1a01ca3..2edf7a41 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/statistics/MyStatistics.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/feature/statistics/MyStatistics.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.model.statistics +package ac.dnd.bookkeeping.android.domain.model.feature.statistics import kotlinx.datetime.LocalDate diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/group/Group.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/group/Group.kt deleted file mode 100644 index ecb657d3..00000000 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/model/group/Group.kt +++ /dev/null @@ -1,6 +0,0 @@ -package ac.dnd.bookkeeping.android.domain.model.group - -data class Group( - val id: Long, - val name: String -) diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/GroupRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/GroupRepository.kt index 77c81e72..d6b48618 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/GroupRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/GroupRepository.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group interface GroupRepository { diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/HeartRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/HeartRepository.kt index 163d6cf3..16f699b3 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/HeartRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/HeartRepository.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.heart.Heart -import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.Heart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart import kotlinx.datetime.LocalDate interface HeartRepository { @@ -21,7 +21,7 @@ interface HeartRepository { money: Long, day: LocalDate, event: String, - memo: String = "", + memo: String, tags: List ): Result @@ -36,12 +36,12 @@ interface HeartRepository { ): Result suspend fun getHeartList( - sort: String = "recent", - name: String = "" + sort: String, + name: String ): Result> suspend fun getRelatedHeartList( id: Long, - sort: String = "recent" + sort: String ): Result> } diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/KakaoLoginRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/KakaoLoginRepository.kt index 6dada2df..5b81e5e4 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/KakaoLoginRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/KakaoLoginRepository.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.sociallogin.KakaoUserInformation +import ac.dnd.bookkeeping.android.domain.model.authentication.sociallogin.KakaoUserInformation interface KakaoLoginRepository { suspend fun login(): Result diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/RelationRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/RelationRepository.kt index 92801e14..018dfae7 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/RelationRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/RelationRepository.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple interface RelationRepository { @@ -9,7 +9,7 @@ interface RelationRepository { groupId: Long, name: String, imageUrl: String, - memo: String = "" + memo: String ): Result suspend fun editRelation( @@ -17,7 +17,7 @@ interface RelationRepository { groupId: Long, name: String, imageUrl: String, - memo: String = "" + memo: String ): Result suspend fun deleteRelation( @@ -29,6 +29,6 @@ interface RelationRepository { ): Result suspend fun getRelationList( - name: String = "" + name: String ): Result> } diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/ScheduleRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/ScheduleRepository.kt index 7a5d1da6..6a874ff6 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/ScheduleRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/ScheduleRepository.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedSchedule +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedSchedule import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalTime @@ -17,7 +17,7 @@ interface ScheduleRepository { time: LocalTime, link: String, location: String, - memo: String = "", + memo: String, ): Result suspend fun editSchedule( @@ -31,7 +31,7 @@ interface ScheduleRepository { time: LocalTime, link: String, location: String, - memo: String = "", + memo: String, ): Result suspend fun deleteSchedule( @@ -39,6 +39,6 @@ interface ScheduleRepository { ): Result suspend fun getUnrecordedScheduleList( - name: String = "" + name: String ): Result> } diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/StatisticsRepository.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/StatisticsRepository.kt index ec02e630..2a28d489 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/StatisticsRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/repository/StatisticsRepository.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.domain.repository -import ac.dnd.bookkeeping.android.domain.model.statistics.GroupStatistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.GroupStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatistics interface StatisticsRepository { diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/authentication/sociallogin/GetKakaoUserInfoUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/authentication/sociallogin/GetKakaoUserInfoUseCase.kt index fe32779f..103c4c8e 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/authentication/sociallogin/GetKakaoUserInfoUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/authentication/sociallogin/GetKakaoUserInfoUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.authentication.sociallogin -import ac.dnd.bookkeeping.android.domain.model.sociallogin.KakaoUserInformation +import ac.dnd.bookkeeping.android.domain.model.authentication.sociallogin.KakaoUserInformation import ac.dnd.bookkeeping.android.domain.repository.KakaoLoginRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListUseCase.kt index 29b90b3d..2d588e7a 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.group -import ac.dnd.bookkeeping.android.domain.model.group.Group +import ac.dnd.bookkeeping.android.domain.model.feature.group.Group import ac.dnd.bookkeeping.android.domain.repository.GroupRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListWithRelationUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListWithRelationUseCase.kt new file mode 100644 index 00000000..19c32574 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/group/GetGroupListWithRelationUseCase.kt @@ -0,0 +1,24 @@ +package ac.dnd.bookkeeping.android.domain.usecase.feature.group + +import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelation +import ac.dnd.bookkeeping.android.domain.usecase.feature.relation.GetRelationListUseCase +import javax.inject.Inject + +class GetGroupListWithRelationUseCase @Inject constructor( + private val getRelationListUseCase: GetRelationListUseCase +) { + suspend operator fun invoke(): Result> { + return getRelationListUseCase("").map { relationList -> + relationList.groupBy { + it.group.id + }.map { (_, relationList) -> + val group = relationList.first().group + GroupWithRelation( + id = group.id, + name = group.name, + relationList = relationList + ) + } + } + } +} diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetHeartListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetHeartListUseCase.kt index ccc6b306..10828cf4 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetHeartListUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetHeartListUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.heart -import ac.dnd.bookkeeping.android.domain.model.heart.Heart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.Heart import ac.dnd.bookkeeping.android.domain.repository.HeartRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetRelatedHeartListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetRelatedHeartListUseCase.kt index 500c02f6..c864802e 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetRelatedHeartListUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/heart/GetRelatedHeartListUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.heart -import ac.dnd.bookkeeping.android.domain.model.heart.RelatedHeart +import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart import ac.dnd.bookkeeping.android.domain.repository.HeartRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/EditRelationWithUploadUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/EditRelationWithUploadUseCase.kt new file mode 100644 index 00000000..599a1a76 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/EditRelationWithUploadUseCase.kt @@ -0,0 +1,31 @@ +package ac.dnd.bookkeeping.android.domain.usecase.feature.relation + +import ac.dnd.bookkeeping.android.domain.usecase.file.GetUrlAndUploadImageUseCase +import javax.inject.Inject + +class EditRelationWithUploadUseCase @Inject constructor( + private val editRelationUseCase: EditRelationUseCase, + private val getUrlAndUploadImageUseCase: GetUrlAndUploadImageUseCase +) { + suspend operator fun invoke( + id: Long, + groupId: Long, + name: String, + imageUrl: String, + imageName: String, + memo: String + ): Result { + return getUrlAndUploadImageUseCase( + imageUri = imageUrl, + fileName = imageName + ).map { imageUrl -> + editRelationUseCase( + id = id, + groupId = groupId, + name = name, + imageUrl = imageUrl, + memo = memo + ).getOrThrow() + } + } +} diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationListUseCase.kt index ab6412aa..348c1369 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationListUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationListUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.relation -import ac.dnd.bookkeeping.android.domain.model.relation.RelationSimple +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple import ac.dnd.bookkeeping.android.domain.repository.RelationRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationUseCase.kt index a1fa00c8..549a7b1e 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/relation/GetRelationUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.relation -import ac.dnd.bookkeeping.android.domain.model.relation.RelationDetail +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationDetail import ac.dnd.bookkeeping.android.domain.repository.RelationRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/GetUnrecordedScheduleListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/GetUnrecordedScheduleListUseCase.kt index d46540a9..dd9dec97 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/GetUnrecordedScheduleListUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/schedule/GetUnrecordedScheduleListUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.schedule -import ac.dnd.bookkeeping.android.domain.model.schedule.UnrecordedSchedule +import ac.dnd.bookkeeping.android.domain.model.feature.schedule.UnrecordedSchedule import ac.dnd.bookkeeping.android.domain.repository.ScheduleRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetGroupStatisticsUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetGroupStatisticsUseCase.kt index fdc65bba..40ed0beb 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetGroupStatisticsUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetGroupStatisticsUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.statistics -import ac.dnd.bookkeeping.android.domain.model.statistics.GroupStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.GroupStatistics import ac.dnd.bookkeeping.android.domain.repository.StatisticsRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetMyStatisticsUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetMyStatisticsUseCase.kt index 485cd0f8..e7a5e0ce 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetMyStatisticsUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/statistics/GetMyStatisticsUseCase.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.domain.usecase.feature.statistics -import ac.dnd.bookkeeping.android.domain.model.statistics.MyStatistics +import ac.dnd.bookkeeping.android.domain.model.feature.statistics.MyStatistics import ac.dnd.bookkeeping.android.domain.repository.StatisticsRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/file/GetUrlAndUploadImageUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/file/GetUrlAndUploadImageUseCase.kt new file mode 100644 index 00000000..13587ad1 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/file/GetUrlAndUploadImageUseCase.kt @@ -0,0 +1,24 @@ +package ac.dnd.bookkeeping.android.domain.usecase.file + +import javax.inject.Inject + +class GetUrlAndUploadImageUseCase @Inject constructor( + private val getPreSignedUrlUseCase: GetPreSignedUrlUseCase, + private val uploadImageUseCase: UploadImageUseCase +) { + suspend operator fun invoke( + imageUri: String, + fileName: String + ): Result { + return getPreSignedUrlUseCase( + fileName = fileName + ).map { preSignedUrl -> + uploadImageUseCase( + preSignedUrl = preSignedUrl.preSignedUrl, + imageUri = imageUri + ).getOrThrow() + + preSignedUrl.uploadFileUrl + } + } +} diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/legacy/GetGroupListUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/legacy/GetGroupListUseCase.kt deleted file mode 100644 index 4d73d938..00000000 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/legacy/GetGroupListUseCase.kt +++ /dev/null @@ -1,71 +0,0 @@ -package ac.dnd.bookkeeping.android.domain.usecase.legacy - -import ac.dnd.bookkeeping.android.domain.model.legacy.GroupLegacy -import ac.dnd.bookkeeping.android.domain.model.legacy.RelationLegacy -import ac.dnd.bookkeeping.android.domain.model.legacy.RelationGroupLegacy -import ac.dnd.bookkeeping.android.domain.repository.MemberRepository -import javax.inject.Inject - -class GetGroupListUseCase @Inject constructor( - private val memberRepository: MemberRepository -) { - suspend operator fun invoke(): Result> { - // TODO - return Result.success( - listOf( - GroupLegacy( - id = 2337, - name = "Angelia McBride", - relations = listOf( - RelationLegacy( - id = 9922, - name = "Patty Meadows", - group = RelationGroupLegacy( - id = 2337, - name = "Angelia McBride", - ), - giveMoney = 8246, - takeMoney = 5441 - ), - RelationLegacy( - id = 1447, - name = "Margery Hyde", - group = RelationGroupLegacy( - id = 2337, - name = "Angelia McBride", - ), - giveMoney = 2859, - takeMoney = 1341 - ), - RelationLegacy( - id = 8446, - name = "Harlan Yang", - group = RelationGroupLegacy( - id = 2337, - name = "Angelia McBride", - ), - giveMoney = 8327, - takeMoney = 4954 - ) - ) - ), - GroupLegacy( - id = 6599, - name = "Andrea Serrano", - relations = listOf( - RelationLegacy( - id = 3679, - name = "Jerome Pitts", - group = RelationGroupLegacy( - id = 6599, - name = "Andrea Serrano", - ), - giveMoney = 4190, - takeMoney = 4010 - ) - ) - ) - ) - ) - } -} diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/CheckNicknameUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/CheckNicknameUseCase.kt similarity index 85% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/CheckNicknameUseCase.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/CheckNicknameUseCase.kt index 7273e056..20cf8484 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/CheckNicknameUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/CheckNicknameUseCase.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.usecase.feature.member +package ac.dnd.bookkeeping.android.domain.usecase.member import ac.dnd.bookkeeping.android.domain.repository.MemberRepository import javax.inject.Inject diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/EditProfileUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileUseCase.kt similarity index 90% rename from domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/EditProfileUseCase.kt rename to domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileUseCase.kt index 563241da..944c39c3 100644 --- a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/feature/member/EditProfileUseCase.kt +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileUseCase.kt @@ -1,4 +1,4 @@ -package ac.dnd.bookkeeping.android.domain.usecase.feature.member +package ac.dnd.bookkeeping.android.domain.usecase.member import ac.dnd.bookkeeping.android.domain.repository.MemberRepository import kotlinx.datetime.LocalDate diff --git a/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileWithUploadUseCase.kt b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileWithUploadUseCase.kt new file mode 100644 index 00000000..ae38e388 --- /dev/null +++ b/domain/src/main/kotlin/ac/dnd/bookkeeping/android/domain/usecase/member/EditProfileWithUploadUseCase.kt @@ -0,0 +1,30 @@ +package ac.dnd.bookkeeping.android.domain.usecase.member + +import ac.dnd.bookkeeping.android.domain.usecase.file.GetUrlAndUploadImageUseCase +import kotlinx.datetime.LocalDate +import javax.inject.Inject + +class EditProfileWithUploadUseCase @Inject constructor( + private val editProfileUseCase: EditProfileUseCase, + private val getUrlAndUploadImageUseCase: GetUrlAndUploadImageUseCase +) { + suspend operator fun invoke( + profileImageUri: String, + profileImageName: String, + nickname: String, + gender: String, + birth: LocalDate + ): Result { + return getUrlAndUploadImageUseCase( + imageUri = profileImageUri, + fileName = profileImageName + ).map { profileImageUrl -> + editProfileUseCase( + profileImageUrl = profileImageUrl, + nickname = nickname, + gender = gender, + birth = birth + ).getOrThrow() + } + } +} diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/model/login/KakaoUserInformationModel.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/model/login/KakaoUserInformationModel.kt index 40a0b86d..c9a1999c 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/model/login/KakaoUserInformationModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/model/login/KakaoUserInformationModel.kt @@ -1,6 +1,6 @@ package ac.dnd.bookkeeping.android.presentation.model.login -import ac.dnd.bookkeeping.android.domain.model.sociallogin.KakaoUserInformation +import ac.dnd.bookkeeping.android.domain.model.authentication.sociallogin.KakaoUserInformation import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationModel.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationModel.kt index 9a926a6d..59d411cb 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationModel.kt @@ -1,10 +1,10 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.home.event.common.relation -import ac.dnd.bookkeeping.android.domain.model.legacy.GroupLegacy +import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelation import androidx.compose.runtime.Immutable @Immutable data class SearchRelationModel( val state: SearchRelationState, - val groups: List + val groups: List ) diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationScreen.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationScreen.kt index e2332d40..75f5bafb 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationScreen.kt @@ -1,7 +1,7 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.home.event.common.relation -import ac.dnd.bookkeeping.android.domain.model.legacy.GroupLegacy -import ac.dnd.bookkeeping.android.domain.model.legacy.RelationLegacy +import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelation +import ac.dnd.bookkeeping.android.domain.model.feature.relation.RelationSimple import ac.dnd.bookkeeping.android.presentation.R import ac.dnd.bookkeeping.android.presentation.common.theme.Body0 import ac.dnd.bookkeeping.android.presentation.common.theme.Body1 @@ -67,7 +67,7 @@ import kotlinx.coroutines.CoroutineExceptionHandler fun SearchRelationScreen( appState: ApplicationState, onDismissRequest: () -> Unit, - onResult: (RelationLegacy) -> Unit, + onResult: (RelationSimple) -> Unit, viewModel: SearchRelationViewModel = hiltViewModel() ) { val model: SearchRelationModel = Unit.let { @@ -100,14 +100,14 @@ private fun SearchRelationScreen( intent: (SearchRelationIntent) -> Unit, handler: CoroutineExceptionHandler, onDismissRequest: () -> Unit, - onResult: (RelationLegacy) -> Unit, + onResult: (RelationSimple) -> Unit, ) { var text by remember { mutableStateOf("") } - var selectedRelation: RelationLegacy? by remember { mutableStateOf(null) } + var selectedRelation: RelationSimple? by remember { mutableStateOf(null) } val lowerText = text.lowercase() val filteredGroups = model.groups.filter { group -> - group.relations.any { relation -> + group.relationList.any { relation -> relation.name.lowercase().contains(lowerText) } || group.name.lowercase().contains(lowerText) } @@ -238,11 +238,11 @@ private fun SearchRelationScreen( @Composable @OptIn(ExperimentalMaterialApi::class) private fun SearchRelationGroup( - group: GroupLegacy, - selectedRelation: RelationLegacy?, + group: GroupWithRelation, + selectedRelation: RelationSimple?, isExpanded: Boolean, onExpandRequest: () -> Unit, - onClick: (RelationLegacy) -> Unit + onClick: (RelationSimple) -> Unit ) { Column( modifier = Modifier.fillMaxSize() @@ -273,7 +273,7 @@ private fun SearchRelationGroup( ) Text( modifier = Modifier.weight(1f), - text = group.relations.size.toString(), + text = group.relationList.size.toString(), style = Headline3.merge(Gray700) ) if (isExpanded) { @@ -299,9 +299,9 @@ private fun SearchRelationGroup( shape = Shapes.large ) { Column { - group.relations.forEachIndexed { index, relation -> + group.relationList.forEachIndexed { index, relation -> SearchRelationRelation(relation, selectedRelation, onClick) - if (index < group.relations.size - 1) { + if (index < group.relationList.size - 1) { Divider(modifier = Modifier.height(1.dp)) } } @@ -316,9 +316,9 @@ private fun SearchRelationGroup( @Composable @OptIn(ExperimentalMaterialApi::class) private fun SearchRelationRelation( - relation: RelationLegacy, - selectedRelation: RelationLegacy?, - onClick: (RelationLegacy) -> Unit + relation: RelationSimple, + selectedRelation: RelationSimple?, + onClick: (RelationSimple) -> Unit ) { Surface( modifier = Modifier diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationViewModel.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationViewModel.kt index 368c9425..4403b4ae 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationViewModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/home/event/common/relation/SearchRelationViewModel.kt @@ -1,9 +1,8 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.home.event.common.relation import ac.dnd.bookkeeping.android.domain.model.error.ServerException -import ac.dnd.bookkeeping.android.domain.model.legacy.GroupLegacy -import ac.dnd.bookkeeping.android.domain.usecase.feature.member.CheckNicknameUseCase -import ac.dnd.bookkeeping.android.domain.usecase.legacy.GetGroupListUseCase +import ac.dnd.bookkeeping.android.domain.model.feature.group.GroupWithRelation +import ac.dnd.bookkeeping.android.domain.usecase.feature.group.GetGroupListWithRelationUseCase import ac.dnd.bookkeeping.android.presentation.common.base.BaseViewModel import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.MutableEventFlow @@ -18,8 +17,7 @@ import javax.inject.Inject @HiltViewModel class SearchRelationViewModel @Inject constructor( private val savedStateHandle: SavedStateHandle, - private val getGroupListUseCase: GetGroupListUseCase, - private val checkNicknameUseCase: CheckNicknameUseCase + private val getGroupListWithRelationUseCase: GetGroupListWithRelationUseCase ) : BaseViewModel() { private val _state: MutableStateFlow = @@ -29,13 +27,13 @@ class SearchRelationViewModel @Inject constructor( private val _event: MutableEventFlow = MutableEventFlow() val event: EventFlow = _event.asEventFlow() - private val _groups: MutableStateFlow> = MutableStateFlow(emptyList()) - val groups: StateFlow> = _groups.asStateFlow() + private val _groups: MutableStateFlow> = MutableStateFlow(emptyList()) + val groups: StateFlow> = _groups.asStateFlow() init { launch { _state.value = SearchRelationState.Loading - getGroupListUseCase() + getGroupListWithRelationUseCase() .onSuccess { _groups.value = it }.onFailure { exception -> diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/main/RegistrationMainViewModel.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/main/RegistrationMainViewModel.kt index b7479ba7..f85c3f05 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/main/RegistrationMainViewModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/main/RegistrationMainViewModel.kt @@ -2,7 +2,7 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.registration.main import ac.dnd.bookkeeping.android.domain.model.error.ServerException import ac.dnd.bookkeeping.android.domain.usecase.authentication.RegistrationUseCase -import ac.dnd.bookkeeping.android.domain.usecase.feature.member.CheckNicknameUseCase +import ac.dnd.bookkeeping.android.domain.usecase.member.CheckNicknameUseCase import ac.dnd.bookkeeping.android.presentation.common.base.BaseViewModel import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.MutableEventFlow