Conversation
- RoutineByDayDeletion: 특정 날짜의 루틴 삭제 정보 - SubRoutineDeletionInfo: 하위 루틴 삭제 정보
- RoutineByDayDeletion DTO 및 Mapper 추가
- 루틴 당일 삭제를 위한 유스케이스 및 UI 로직 추가 - RoutineUiModel 및 SubRoutineUiModel에 삭제 정보 변환 메소드 추가 - 삭제 확인 다이얼로그에서 당일 삭제 기능 연동
- 사용자 프로필 정보 조회 API 연동 - 홈 화면에 사용자 닉네임 표시 - 관련 DataSource, Repository, UseCase, DTO, DI 모듈 추가
- 조회한 나의 감정에 따른 감정 구슬을 홈 화면에서 표시하는 기능 구현
|
""" Walkthrough이번 변경은 홈 화면에 필요한 신규 API(회원 조회, 감정구슬, 반복 루틴 삭제) 연동을 중심으로, 도메인-데이터-프레젠테이션 계층 전반에 걸쳐 모델, 데이터소스, 레포지토리, 유스케이스, DI 모듈, 뷰모델, UI 상태 및 Intent, 매핑 함수, 서비스 인터페이스 등을 추가 및 확장하였습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as HomeScreen
participant VM as HomeViewModel
participant UseCase1 as FetchUserProfileUseCase
participant UseCase2 as GetMyEmotionUseCase
participant UseCase3 as DeleteRoutineByDayUseCase
participant Repo as Repository
participant DS as DataSource
participant Service as Service
%% 사용자 진입 시
UI->>VM: 화면 진입
activate VM
VM->>UseCase1: fetchUserProfile()
VM->>UseCase2: getMyEmotion(currentDate)
UseCase1->>Repo: fetchUserProfile()
UseCase2->>Repo: getMyEmotionMarble(currentDate)
Repo->>DS: fetchUserProfile() / getMyEmotionMarble()
DS->>Service: API 호출
Service-->>DS: 응답
DS-->>Repo: Result 반환
Repo-->>UseCase1: Result<UserProfile>
Repo-->>UseCase2: Result<MyEmotion>
UseCase1-->>VM: Result<UserProfile>
UseCase2-->>VM: Result<MyEmotion>
VM-->>UI: 상태 업데이트(닉네임/감정구슬)
%% 루틴 삭제 시
UI->>VM: onDeleteToday(routine)
VM->>UseCase3: deleteRoutineByDay(routineByDayDeletion)
UseCase3->>Repo: deleteRoutineByDay(routineByDayDeletion)
Repo->>DS: deleteRoutineByDay(dto)
DS->>Service: DELETE /api/v1/routines/day
Service-->>DS: 응답
DS-->>Repo: Result<Unit>
Repo-->>UseCase3: Result<Unit>
UseCase3-->>VM: Result<Unit>
VM-->>UI: optimistic update → 실패 시 롤백
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
data/src/main/java/com/threegap/bitnagil/data/routine/service/RoutineService.kt (1)
32-35: DELETE 요청에 body를 포함하는 구현이 올바르게 되어있습니다.
@HTTP어노테이션과hasBody = true옵션을 사용하여 DELETE 요청에 body를 포함하는 것이 기술적으로 올바릅니다.@DELETE어노테이션은 기본적으로 body를 지원하지 않기 때문입니다.다만 REST API 관점에서 DELETE 요청에 body를 포함하는 것보다는 쿼리 파라미터나 URL 경로를 사용하는 것이 더 일반적입니다. 백엔드 API 설계 시 참고하시기 바랍니다.
domain/src/main/java/com/threegap/bitnagil/domain/routine/model/RoutineByDayDeletion.kt (1)
3-9: 도메인 모델이 깔끔하게 정의되었습니다.필요한 속성들이 적절한 타입으로 정의되어 있고, nullable한
routineCompletionId도 비즈니스 로직에 맞게 설계되었습니다.
performedDate를String대신LocalDate타입으로 사용하는 것을 고려해보세요. 타입 안전성을 높이고 날짜 관련 연산을 더 안전하게 할 수 있습니다.- val performedDate: String, + val performedDate: LocalDate,domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/GetMyEmotionUseCase.kt (1)
7-12: 표준적인 유스케이스 구현입니다.리포지토리로의 위임이 적절하고,
Result타입 사용으로 에러 처리가 잘 되어 있습니다.날짜 형식 검증을 고려해보세요:
suspend operator fun invoke(currentDate: String): Result<MyEmotion> = + if (currentDate.isBlank()) { + Result.failure(IllegalArgumentException("Date cannot be blank")) + } else { emotionRepository.getMyEmotionMarble(currentDate) + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (47)
app/src/main/java/com/threegap/bitnagil/di/data/DataSourceModule.kt(2 hunks)app/src/main/java/com/threegap/bitnagil/di/data/RepositoryModule.kt(2 hunks)app/src/main/java/com/threegap/bitnagil/di/data/ServiceModule.kt(2 hunks)core/network/src/main/java/com/threegap/bitnagil/network/model/AuthToken.kt(0 hunks)data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/emotion/model/response/MyEmotionResponseDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/emotion/repositoryImpl/EmotionRepositoryImpl.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/datasource/RoutineRemoteDataSource.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/datasourceImpl/RoutineRemoteDataSourceImpl.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/mapper/RoutineMapper.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/model/request/RoutineByDayDeletionRequestDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/model/request/SubRoutineDeletionInfoDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/model/response/RoutineDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/model/response/SubRoutineDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/repositoryImpl/RoutineRepositoryImpl.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/routine/service/RoutineService.kt(2 hunks)data/src/main/java/com/threegap/bitnagil/data/user/datasource/UserDataSource.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/user/datasourceImpl/UserDataSourceImpl.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/user/model/response/UserProfileResponseDto.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/user/repositoryImpl/UserRepositoryImpl.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/MyEmotion.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/emotion/repository/EmotionRepository.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/GetMyEmotionUseCase.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/model/Routine.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/model/RoutineByDayDeletion.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/model/SubRoutine.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/model/SubRoutineDeletionInfo.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/repository/RoutineRepository.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/routine/usecase/DeleteRoutineByDayUseCase.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/user/model/UserProfile.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/user/repository/UserRepository.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/user/usecase/FetchUserProfileUseCase.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt(2 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt(8 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/block/RoutineItem.kt(3 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/block/SubRoutinesItem.kt(3 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/CollapsibleHomeHeader.kt(3 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/RoutineDetailsBottomSheet.kt(4 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/RoutineSection.kt(4 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/EmotionBallType.kt(2 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/HomeIntent.kt(2 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/HomeState.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/RoutineUiModel.kt(3 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/SubRoutineUiModel.kt(3 hunks)
💤 Files with no reviewable changes (1)
- core/network/src/main/java/com/threegap/bitnagil/network/model/AuthToken.kt
🧰 Additional context used
🧠 Learnings (4)
presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/SubRoutineUiModel.kt (2)
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, @parcelize annotation works correctly without explicitly adding Parcelable implementation.
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, @parcelize annotation works correctly without explicitly adding Parcelable implementation.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/RoutineUiModel.kt (2)
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, @parcelize annotation works correctly without explicitly adding Parcelable implementation.
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, @parcelize annotation works correctly without explicitly adding Parcelable implementation.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt (1)
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageIntent.kt:6-6
Timestamp: 2025-07-23T13:32:26.263Z
Learning: In the Bitnagil Android project's MVI architecture, Intent classes like LoadMyPageSuccess are named to represent successful API response results that carry loaded data, not just user actions. This naming convention is used for future API integration where the intent will be triggered when my page data loading succeeds from the server.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/HomeIntent.kt (1)
Learnt from: l5x5l
PR: #41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageIntent.kt:6-6
Timestamp: 2025-07-23T13:32:26.263Z
Learning: In the Bitnagil Android project's MVI architecture, Intent classes like LoadMyPageSuccess are named to represent successful API response results that carry loaded data, not just user actions. This naming convention is used for future API integration where the intent will be triggered when my page data loading succeeds from the server.
🧬 Code Graph Analysis (4)
data/src/main/java/com/threegap/bitnagil/data/user/datasourceImpl/UserDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
safeApiCall(10-25)
data/src/main/java/com/threegap/bitnagil/data/routine/datasourceImpl/RoutineRemoteDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
safeUnitApiCall(27-35)
presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt (6)
data/src/main/java/com/threegap/bitnagil/data/user/datasource/UserDataSource.kt (2)
fetchUserProfile(5-7)fetchUserProfile(6-6)data/src/main/java/com/threegap/bitnagil/data/user/datasourceImpl/UserDataSourceImpl.kt (1)
fetchUserProfile(12-15)data/src/main/java/com/threegap/bitnagil/data/user/repositoryImpl/UserRepositoryImpl.kt (1)
fetchUserProfile(12-13)data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt (2)
fetchUserProfile(7-10)fetchUserProfile(8-9)domain/src/main/java/com/threegap/bitnagil/domain/user/repository/UserRepository.kt (2)
fetchUserProfile(5-7)fetchUserProfile(6-6)presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt (1)
sendIntent(30-37)
data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
safeApiCall(10-25)
🔇 Additional comments (66)
domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/MyEmotion.kt (1)
3-7: 깔끔한 도메인 모델 설계입니다.감정 구슬 데이터를 표현하는 간단하고 명확한 데이터 클래스입니다. 모든 프로퍼티가 nullable로 설정되어 API에서 데이터가 항상 제공되지 않을 수 있음을 적절히 반영하고 있습니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/block/SubRoutinesItem.kt (1)
89-89: 프리뷰 데이터 업데이트가 적절합니다.새로 추가된
routineCompletionId프로퍼티를 프리뷰 데이터에 일관되게 반영하여 UI 컴포넌트 프리뷰가 최신 데이터 모델 구조를 정확히 보여줍니다.Also applies to: 99-99, 109-109
domain/src/main/java/com/threegap/bitnagil/domain/routine/model/Routine.kt (1)
11-11: 루틴 완료 추적을 위한 적절한 프로퍼티 추가입니다.
routineCompletionId프로퍼티가 논리적인 위치에 추가되었고, nullable 타입으로 설정되어 완료 ID가 항상 존재하지 않을 수 있는 상황을 적절히 처리합니다.domain/src/main/java/com/threegap/bitnagil/domain/routine/model/SubRoutine.kt (1)
9-9: 일관된 도메인 모델 업데이트입니다.
SubRoutine모델에routineCompletionId프로퍼티를 추가하여Routine모델과 일관성을 유지하고 있습니다. nullable 타입과 프로퍼티 위치가 적절합니다.domain/src/main/java/com/threegap/bitnagil/domain/user/model/UserProfile.kt (1)
3-5: 간결하고 명확한 사용자 프로필 모델입니다.필수 정보인 닉네임만을 포함한 단순하고 집중된 도메인 모델 설계가 좋습니다. non-nullable String 타입으로 닉네임이 항상 필요한 데이터임을 명확히 표현하고 있습니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/RoutineDetailsBottomSheet.kt (1)
269-269: 프리뷰 컴포저블 업데이트가 올바릅니다.새로 추가된
routineCompletionId필드를 포함하도록 프리뷰 데이터가 적절히 업데이트되었습니다. 하드코딩된 값 1은 프리뷰 데이터로 적합합니다.Also applies to: 277-277, 287-287, 297-297, 320-320
data/src/main/java/com/threegap/bitnagil/data/routine/model/response/SubRoutineDto.kt (1)
18-19: DTO 필드 추가가 적절합니다.
routineCompletionId필드가 올바른 직렬화 어노테이션과 함께 추가되었으며, nullable 타입 사용이 적절합니다. 일별 루틴 삭제 기능을 지원하기 위한 변경사항이 잘 구현되었습니다.data/src/main/java/com/threegap/bitnagil/data/routine/model/response/RoutineDto.kt (1)
22-23: DTO 필드 추가가 일관성 있게 구현되었습니다.
routineCompletionId필드가SubRoutineDto와 동일한 패턴으로 올바르게 추가되었습니다. 직렬화 어노테이션과 nullable 타입 사용이 적절합니다.data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt (1)
4-4: 감정 데이터 조회 메서드가 적절히 추가되었습니다.새로운
getMyEmotionMarble메서드가 기존 인터페이스 패턴을 일관성 있게 따르고 있습니다.Result래퍼를 사용한 에러 처리와 suspend 함수 사용이 적절합니다.Also applies to: 10-10
presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt (2)
84-84: 일별 루틴 삭제 플로우가 올바르게 연결되었습니다.새로운
deleteRoutineByDay메서드를 호출하여 일별 루틴 삭제 기능이 적절히 구현되었습니다.
243-244: 동적 데이터 사용으로 UI가 개선되었습니다.하드코딩된 사용자명 대신
uiState.userNickname을 사용하고, 감정 구슬 타입을 동적으로 표시하도록 변경된 것이 적절합니다. 새로운 API 연동과 잘 연결되어 있습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/RoutineSection.kt (1)
110-110: 미리보기 데이터 업데이트가 일관되게 적용되었습니다.새로운
routineCompletionId필드가 메인 루틴과 모든 서브 루틴에 일관되게 추가되었으며, 테스트용으로 적절한 값(1)이 사용되었습니다.Also applies to: 119-119, 129-129, 139-139
app/src/main/java/com/threegap/bitnagil/di/data/RepositoryModule.kt (2)
7-7: 필요한 import 문이 올바르게 추가되었습니다.UserRepository 인터페이스와 구현체 import가 적절히 추가되었습니다.
Also applies to: 13-13
45-47: UserRepository DI 바인딩이 올바르게 구성되었습니다.기존 패턴을 따라 @BINDS와 @singleton 어노테이션이 적절히 사용되었으며, 사용자 프로필 기능을 위한 의존성 주입이 정상적으로 설정되었습니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/block/RoutineItem.kt (1)
81-81: 미리보기 데이터가 일관되게 업데이트되었습니다.
routineCompletionId필드가 모든 루틴 및 서브루틴 모델에 일관되게 추가되어 새로운 도메인 모델 구조와 일치합니다.Also applies to: 89-89, 99-99, 109-109
domain/src/main/java/com/threegap/bitnagil/domain/emotion/repository/EmotionRepository.kt (2)
4-4: 필요한 도메인 모델 import가 추가되었습니다.새로운
MyEmotion도메인 모델 import가 적절히 추가되었습니다.
9-9: 감정 데이터 조회 메서드가 올바르게 정의되었습니다.새로운
getMyEmotionMarble메서드가 기존 인터페이스 패턴을 따라 일관되게 구현되었습니다.Result래퍼를 사용한 에러 핸들링과 명확한 메서드 시그니처가 적절합니다.domain/src/main/java/com/threegap/bitnagil/domain/routine/model/SubRoutineDeletionInfo.kt (1)
1-6: 서브루틴 삭제 정보 도메인 모델이 적절히 구성되었습니다.데이터 클래스 구조가 명확하고, 필드의 nullable 설정이 합리적입니다.
routineCompletionId는 nullable로,subRoutineId는 non-nullable로 설정되어 도메인 로직에 적합합니다.domain/src/main/java/com/threegap/bitnagil/domain/routine/repository/RoutineRepository.kt (2)
3-3: 새로운 import가 올바르게 추가되었습니다.
RoutineByDayDeletion모델에 대한 import가 적절히 추가되어 새로운 메서드에서 사용할 수 있습니다.
11-11: 인터페이스 메서드가 일관된 패턴을 따릅니다.새로운
deleteRoutineByDay메서드가 기존 메서드들과 동일한 패턴(suspend function, Result 반환 타입)을 따르고 있어 인터페이스의 일관성이 유지됩니다.data/src/main/java/com/threegap/bitnagil/data/user/datasource/UserDataSource.kt (1)
1-7: 깔끔한 데이터소스 인터페이스 설계입니다.인터페이스가 단일 책임 원칙을 따르고 있으며, suspend function과 Result 타입을 사용하여 프로젝트의 일관된 패턴을 유지하고 있습니다.
app/src/main/java/com/threegap/bitnagil/di/data/ServiceModule.kt (2)
7-7: UserService import가 올바르게 추가되었습니다.새로운 서비스에 대한 import가 알파벳 순서에 맞게 적절히 배치되었습니다.
53-56: 일관된 DI 패턴을 따르는 서비스 제공자입니다.새로운
provideUserService메서드가 기존 서비스 제공자들과 동일한 패턴(@provides, @singleton, @Auth retrofit 사용)을 따르고 있어 의존성 주입 설정이 일관성 있게 유지됩니다.domain/src/main/java/com/threegap/bitnagil/domain/user/repository/UserRepository.kt (1)
1-7: 도메인 계층의 깔끔한 레포지토리 인터페이스입니다.레포지토리가 도메인 모델을 반환하여 계층 간 분리를 명확히 하고 있으며, suspend function과 Result 타입 사용으로 일관된 패턴을 유지하고 있습니다.
data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt (2)
5-5: 필요한 import들이 올바르게 추가되었습니다.새로운 API 메서드에 필요한
MyEmotionResponseDto와@Query어노테이션의 import가 적절히 추가되었습니다.Also applies to: 11-11
22-25: RESTful 설계 원칙을 잘 따른 API 엔드포인트입니다.
getMyEmotionMarble메서드가 적절한 HTTP GET 요청을 사용하고, 쿼리 파라미터로 날짜 필터링을 구현하여 RESTful API 설계 원칙을 잘 따르고 있습니다.app/src/main/java/com/threegap/bitnagil/di/data/DataSourceModule.kt (1)
13-14: 사용자 데이터 소스 바인딩이 올바르게 추가되었습니다새로운
UserDataSource바인딩이 기존 패턴을 일관되게 따르고 있으며, 필요한 import 문도 적절히 추가되었습니다.Also applies to: 51-53
data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt (2)
7-7: 필요한 import가 적절히 추가되었습니다
MyEmotionResponseDtoimport가 새로운 메서드를 지원하기 위해 올바르게 추가되었습니다.
28-31: 감정 구슬 조회 메서드가 올바르게 구현되었습니다새로운
getMyEmotionMarble메서드가 기존 패턴을 일관되게 따르며safeApiCall을 적절히 사용하고 있습니다. 매개변수와 반환 타입도 적절합니다.data/src/main/java/com/threegap/bitnagil/data/emotion/repositoryImpl/EmotionRepositoryImpl.kt (2)
4-4: 필요한 import 문이 적절히 추가되었습니다새로운 기능을 위해
toDomain확장 함수와MyEmotion도메인 모델 import가 올바르게 추가되었습니다.Also applies to: 6-6
42-43: 리포지토리 메서드가 올바른 패턴으로 구현되었습니다
getMyEmotionMarble메서드가 데이터 소스에 위임하고toDomain()확장 함수를 사용해 DTO를 도메인 모델로 매핑하는 올바른 리포지토리 패턴을 따르고 있습니다.data/src/main/java/com/threegap/bitnagil/data/routine/datasourceImpl/RoutineRemoteDataSourceImpl.kt (2)
6-6: 필요한 import가 올바르게 추가되었습니다새로운 삭제 기능을 위해
RoutineByDayDeletionRequestDtoimport가 적절히 추가되었습니다.
30-33: 일별 루틴 삭제 메서드가 올바르게 구현되었습니다새로운
deleteRoutineByDay메서드가safeUnitApiCall을 적절히 사용하여 기존 패턴을 일관되게 따르고 있습니다. Unit 반환 타입에 대해 올바른 wrapper를 사용했습니다.data/src/main/java/com/threegap/bitnagil/data/routine/mapper/RoutineMapper.kt (1)
32-32: 매핑 함수에 routineCompletionId 속성이 일관되게 추가되었습니다
RoutineDto와SubRoutineDto의toDomain()매핑 함수 모두에routineCompletionId속성이 올바르게 추가되어, DTO와 도메인 모델 간의 일관성을 보장하고 있습니다.Also applies to: 45-45
data/src/main/java/com/threegap/bitnagil/data/routine/datasource/RoutineRemoteDataSource.kt (2)
3-3: 새로운 DTO 임포트가 적절히 추가되었습니다.
RoutineByDayDeletionRequestDto임포트가 새로 추가된 메서드에 필요한 의존성을 올바르게 제공합니다.
11-11: 일관된 인터페이스 설계가 잘 적용되었습니다.새로운
deleteRoutineByDay메서드가 기존 메서드들과 동일한 패턴(suspend함수,Result<Unit>반환 타입)을 따르고 있어 일관성 있는 인터페이스를 유지하고 있습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/EmotionBallType.kt (1)
6-6: 도메인 모델 임포트가 적절히 추가되었습니다.프레젠테이션 레이어에서 도메인 레이어의
Emotion모델을 사용하는 것이 클린 아키텍처 원칙에 부합합니다.domain/src/main/java/com/threegap/bitnagil/domain/user/usecase/FetchUserProfileUseCase.kt (1)
7-12: 유스케이스 구현이 클린 아키텍처 원칙을 잘 따르고 있습니다.생성자 의존성 주입을 사용하고 있으며,
operator fun invoke()를 통해 깔끔한 호출 인터페이스를 제공합니다. 레포지토리에 위임하는 단순한 구조로 단일 책임 원칙을 잘 지키고 있습니다.data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt (1)
7-10: Retrofit 서비스 인터페이스가 표준 패턴을 잘 따르고 있습니다.
BaseResponse래퍼를 사용하여 프로젝트의 일관된 API 응답 처리 패턴을 유지하고 있습니다. 엔드포인트 경로(/api/v1/users/nickname)와 메서드명이 명확하게 의도를 표현하고 있습니다.data/src/main/java/com/threegap/bitnagil/data/routine/repositoryImpl/RoutineRepositoryImpl.kt (2)
6-7: 새로운 의존성 임포트가 적절히 추가되었습니다.
toDto매퍼 확장함수와RoutineByDayDeletion도메인 모델 임포트가 새로운 메서드 구현에 필요한 의존성을 올바르게 제공합니다.
26-27: 레포지토리 구현이 일관된 패턴을 따르고 있습니다.새로운
deleteRoutineByDay메서드가 기존 메서드들과 동일한 패턴을 따르고 있습니다 - 도메인 모델을 DTO로 변환한 후 원격 데이터 소스에 위임하는 구조가 클린 아키텍처 원칙에 부합합니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/HomeState.kt (1)
11-12: 새로운 상태 속성들이 깔끔하게 추가되었습니다.
userNickname과myEmotion속성이 적절한 기본값과 함께 추가되었습니다. nullable한EmotionBallType은 초기 로딩 시 감정 데이터가 없을 수 있음을 고려한 좋은 설계입니다.domain/src/main/java/com/threegap/bitnagil/domain/routine/usecase/DeleteRoutineByDayUseCase.kt (1)
7-12: 클린 아키텍처 원칙을 잘 따른 Use Case 구현입니다.의존성 주입과 suspend operator 함수를 사용한 구현이 표준 패턴을 잘 따르고 있습니다. Repository로의 단순한 위임도 적절합니다.
data/src/main/java/com/threegap/bitnagil/data/user/model/response/UserProfileResponseDto.kt (1)
7-16: 표준적인 DTO 구현이 잘 되어있습니다.
@Serializable과@SerialName어노테이션을 사용한 JSON 매핑과 도메인 모델로의 변환 확장함수가 기존 코드베이스의 패턴을 잘 따르고 있습니다.data/src/main/java/com/threegap/bitnagil/data/user/datasourceImpl/UserDataSourceImpl.kt (1)
9-16: 깔끔한 데이터 소스 구현입니다.클린 아키텍처 패턴을 잘 따르고 있으며,
safeApiCall을 사용하여 API 호출 안전성을 보장하고 있습니다. 의존성 주입과 인터페이스 구현이 적절하게 되어 있습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/SubRoutineUiModel.kt (2)
15-15: nullable 속성 추가가 적절합니다.
routineCompletionId를 nullable Int로 추가한 것이 적절합니다. 루틴 완료 추적 및 삭제 기능을 위한 필수 필드입니다.
33-37: 도메인 변환 함수가 잘 구현되었습니다.
toSubRoutineDeletionInfo()확장 함수가 명확하고 간결하게 구현되었습니다. 삭제 기능에 필요한 정보만 추출하여 도메인 모델로 변환하는 역할이 명확합니다.data/src/main/java/com/threegap/bitnagil/data/user/repositoryImpl/UserRepositoryImpl.kt (1)
9-14: 리포지토리 구현이 깔끔합니다.데이터 소스에서 도메인 모델로의 변환이
Result.map을 사용하여 함수형 스타일로 잘 구현되었습니다. 클린 아키텍처 패턴을 적절히 따르고 있습니다.data/src/main/java/com/threegap/bitnagil/data/emotion/model/response/MyEmotionResponseDto.kt (1)
8-16: 직렬화 DTO가 적절하게 구현되었습니다.
@Serializable과@SerialName어노테이션 사용이 올바르고, nullable 속성들이 API 응답 특성을 잘 반영하고 있습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/component/template/CollapsibleHomeHeader.kt (1)
29-29: 감정 볼 타입 동적 연동이 깔끔하게 구현되었습니다.하드코딩된
null값을 제거하고 매개변수로 받아 동적으로 처리하도록 개선된 점이 좋습니다. nullable 타입으로 로딩 상태도 적절히 처리할 수 있습니다.Also applies to: 36-36, 101-101, 154-154
data/src/main/java/com/threegap/bitnagil/data/routine/model/request/SubRoutineDeletionInfoDto.kt (2)
7-13: DTO 구조와 직렬화 설정이 적절합니다.
@Serializable애노테이션과@SerialName매핑이 올바르게 설정되어 있고,routineCompletionId가 nullable로 처리된 것이 적절합니다.
15-19: 도메인 모델 변환 함수가 깔끔하게 구현되었습니다.확장 함수를 사용한 매핑 방식이 코드 가독성과 유지보수성을 높입니다.
data/src/main/java/com/threegap/bitnagil/data/routine/model/request/RoutineByDayDeletionRequestDto.kt (2)
7-19: 일관된 DTO 구조와 명확한 프로퍼티 정의입니다.다른 DTO와 동일한 패턴을 따르고 있으며,
subRoutineInfosForDelete리스트를 포함한 복합 구조도 적절하게 정의되었습니다.
21-28: 리스트 매핑이 포함된 변환 로직이 올바릅니다.
subRoutineInfosForDelete.map { it.toDto() }를 사용하여 중첩된 DTO 변환을 깔끔하게 처리했습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/RoutineUiModel.kt (2)
6-6: 새로운 프로퍼티 추가와 매핑 로직이 일관되게 적용되었습니다.
routineCompletionId를 nullable로 추가하고 도메인 모델 매핑에서도 일관되게 처리한 점이 좋습니다.Also applies to: 19-19, 33-33
38-45: 일별 루틴 삭제를 위한 변환 함수가 적절합니다.
performedDate매개변수를 받아 도메인 모델로 변환하는 로직이 명확하며, 서브루틴 리스트 매핑도 올바르게 구현되었습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/HomeIntent.kt (2)
8-9: 사용자 프로필과 감정 데이터 로딩 인텐트가 적절합니다.기존 네이밍 패턴을 따르고 있으며,
EmotionBallType?을 nullable로 처리한 것이 로딩 상태 처리에 적합합니다.
18-20: 일별 루틴 삭제를 위한 낙관적 업데이트 패턴이 일관됩니다.기존의
DeleteRoutineOptimistically,ConfirmRoutineDeletion,RestoreRoutinesAfterDeleteFailure패턴과 동일한 구조로 일별 삭제 기능을 구현하여 코드 일관성이 좋습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt (8)
6-6: 새로운 의존성 주입이 올바르게 구현되었습니다.새로 추가된 use case들(
GetMyEmotionUseCase,FetchUserProfileUseCase,DeleteRoutineByDayUseCase)이 적절히 주입되고 있으며, 도메인 계층과의 분리가 잘 이루어져 있습니다.Also applies to: 13-13, 41-42, 45-45
71-74: Intent 네이밍이 프로젝트 규칙과 일치합니다.Retrieved learning에 따르면 이 프로젝트의 MVI 아키텍처에서
LoadUserProfile과 같은 Intent 이름은 성공적인 API 응답 결과를 나타내는 규칙을 따르고 있어 적절합니다.
172-199: 새로운 루틴 삭제 로직이 잘 구현되어 있습니다.
DeleteRoutineByDayOptimistically와 관련 Intent들이 기존 패턴과 일관성 있게 구현되었습니다. 낙관적 업데이트와 실패 시 복구 패턴이 기존DeleteRoutineOptimistically로직과 동일한 구조를 따르고 있어 좋습니다.
228-242: 사용자 프로필 fetch 로직이 적절히 구현되었습니다.에러 핸들링과 로딩 상태 관리가 기존 패턴과 일치하며,
fold를 사용한 Result 처리도 올바릅니다. 로그 메시지도 한국어로 일관되게 작성되어 있습니다.
474-503: 루틴 일별 삭제 메서드가 잘 구현되었습니다.
deleteRoutineByDay메서드는 다음과 같은 장점이 있습니다:
- 낙관적 업데이트 패턴을 올바르게 따름
toRoutineByDayDeletion확장 함수를 사용한 도메인 객체 변환- 기존
deleteRoutine메서드와 일관된 에러 핸들링
263-278: 날짜 포맷 및 EmotionBallType 매핑 검토
getMyEmotionUseCase(currentDate.toString())로 넘기는 날짜 문자열이 GetMyEmotionUseCase 및 백엔드(API)가 기대하는 포맷(예: yyyy-MM-dd)과 일치하는지 확인해주세요.EmotionBallType.fromDomainEmotion구현을 검토해, null 반환 시 UI 로직이 안전하게 처리되는지도 함께 점검 부탁드립니다.검토 위치:
- presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt (getMyEmotion 메서드, 263–278행)
- domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/GetMyEmotionUseCase.kt
- presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/EmotionBallType.kt
58-60: API 초기 호출 로직 검토 완료
HomeState의selectedDate기본값은LocalDate.now()로 설정되어 있어, 초기화 시 오늘 날짜로 동작합니다.
따라서getMyEmotion(container.stateFlow.value.selectedDate)호출도 의도대로 오늘 날짜 기반으로 실행되며 추가 수정은 불필요합니다.
15-15: 확인 완료: EmotionBallType 및 toRoutineByDayDeletion 구현 정상
- presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/EmotionBallType.kt
•companion object내fun fromDomainEmotion(emotion: Emotion?): EmotionBallType?구현 확인- presentation/src/main/java/com/threegap/bitnagil/presentation/home/model/RoutineUiModel.kt
•fun RoutineUiModel.toRoutineByDayDeletion(performedDate: String): RoutineByDayDeletion구현 확인위 두 요소가 모두 올바르게 정의되어 있어 추가 수정이 필요 없습니다.
- 루틴 삭제 시 해당 루틴의 상세정보를 보여주는 바텀시트가 올라와 있는 경우 내려가도록 상태 초기화
[ PR Content ]
홈 화면에 추가된 API들을 연동했습니다.
Related issue
Screenshot 📸
Work Description
To Reviewers 📢
Summary by CodeRabbit
신규 기능
개선 및 변경
버그 수정
기타