Skip to content

Conversation

l5x5l
Copy link
Contributor

@l5x5l l5x5l commented Jul 30, 2025

[ PR Content ]

루틴 수정/루틴 작성 화면에서 사용할 단일 루틴/단일 추천 루틴 조회 API를 연동합니다.
기존 API 호출부 중 스웨거와 다른 부분들을 수정합니다.

Related issue

Screenshot 📸

KakaoTalk_Video_2025-07-30-16-33-49.mp4

Work Description

  • 루틴 수정/작성 화면에서 사용하는 루틴 단일 조회 API, 추천 루틴 단일 조회 API를 구현 및 연동했습니다
  • 기존 API 호출부 중 스웨거와 달랐던 request/response를 수정했습니다.

To Reviewers 📢

  • 루틴 작성/수정 이후 홈 화면을 refresh하는 작업이 필요할 것 같습니다! 현재는 해당 부분에 대한 처리가 없어서 새로 업데이트된 루틴을 보려면 다음주로 이동한 후 다시 이전 주로 이동해야 하는 상황입니다!
    • 홈 화면이 bottomNavigation 내부에 있는 route라서 writeRoutineScreen에서 navBackStackEntry에 값을 넣어 결과를 전달하는 방식은 조금 어려울 것 같습니다!
    • 차라리 루틴 작성/수정/삭제를 알리는 flow를 data 레이어 내 배치한 후, 이를 홈 화면에서 collect해서 수정 내역이 존재하면 refresh하는 로직을 적용하면 될 것 같아요!
  • 이 외 궁금하거나 이상한 부분 있다면 코멘트 부탁드립니다!

Summary by CodeRabbit

  • 신규 기능

    • 추천 루틴 및 일반 루틴을 ID로 조회하는 기능이 추가되었습니다.
    • 루틴 작성 시 추천 루틴 기반으로 불러오기가 지원됩니다.
  • 개선 및 변경

    • 루틴, 추천 루틴, 감정 관련 데이터 구조가 개선되어 더 상세한 정보를 제공합니다.
    • 루틴 반복 요일 및 시작 시간이 더 명확하게 처리됩니다.
    • 일부 API 호출 방식이 일관성 있게 개선되었습니다.
    • 루틴 작성 화면에서 인자 전달 방식이 개선되고, 반복 요일 처리 로직이 통일되었습니다.
    • 시간 포맷이 "HH:mm:00" 형식으로 통일되었으며, 요일 매핑 방식이 업데이트되었습니다.
  • 버그 수정

    • 루틴의 서브루틴 정렬이 보장되어 올바른 순서로 표시됩니다.
  • 기타

    • 불필요하거나 중복된 내부 메서드가 정리되었습니다.

l5x5l added 5 commits July 29, 2025 22:19
루틴 등록시 매일을 선택했을 때 요일을 하나도 전달하지 않던 부분과 "하루종일"이 23시 59분이 아닌 00시 00분이 되도록 수정,
응답값이 Unit인 API들을 safeUnitApiCall를 사용하도록 수정
@l5x5l l5x5l requested a review from wjdrjs00 July 30, 2025 07:38
@l5x5l l5x5l self-assigned this Jul 30, 2025
@l5x5l l5x5l added ✨ Feature 새로운 기능 구현 🐞 Fix 버그 수정 세환 labels Jul 30, 2025
Copy link

coderabbitai bot commented Jul 30, 2025

"""

Walkthrough

이 변경사항은 단일 루틴 및 단일 추천 루틴 API 연동과 관련된 대규모 리팩토링 및 기능 추가를 포함합니다. 주요 변경점은 루틴/추천 루틴 조회 API 연결, 기존 API 요청 및 응답 구조의 서버 명세 일치, ViewModel의 Assisted Injection 도입, 데이터/도메인/프레젠테이션 계층 전반의 메서드 시그니처 및 데이터 모델 수정입니다.

Changes

Cohort / File(s) Change Summary
Navigation 및 ViewModel 주입 개선
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
WriteRoutine 경로에서 네비게이션 인자 추출 및 Assisted ViewModel 인스턴스 명시적 주입 로직 추가
Emotion API 및 DTO 구조 변경
data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt, .../datasourceImpl/EmotionDataSourceImpl.kt, .../model/dto/EmotionDto.kt, .../model/dto/EmotionRecommendedRoutineDto.kt, .../model/response/GetEmotionsResponse.kt, .../repositoryImpl/EmotionRepositoryImpl.kt, .../service/EmotionService.kt
Emotion API 응답 타입을 List로 변경, 관련 DTO/Response/Service/Repository 시그니처 및 필드명 일치화, EmotionDto 신규 도입, 불필요한 GetEmotionsResponse 삭제
OnBoarding/RecommendRoutine API 구조 변경 및 신규 메서드 추가
.../onboarding/datasourceImpl/OnBoardingDataSourceImpl.kt, .../onboarding/model/dto/OnBoardingItemDto.kt, .../onboarding/model/dto/OnBoardingRecommendRoutineDto.kt, .../recommendroutine/datasource/RecommendRoutineDataSource.kt, .../datasourceImpl/RecommendRoutineDataSourceImpl.kt, .../repositoryImpl/RecommendRoutineRepositoryImpl.kt, .../service/RecommendRoutineService.kt
추천 루틴 단건 조회 메서드 및 API 추가, OnBoarding 관련 DTO 필드명 및 id값 서버 명세에 맞게 수정, 기존 메서드 safeUnitApiCall 적용
Routine 단건 API 연동
.../routine/datasource/RoutineRemoteDataSource.kt, .../datasourceImpl/RoutineRemoteDataSourceImpl.kt, .../mapper/RoutineMapper.kt, .../repositoryImpl/RoutineRepositoryImpl.kt, .../service/RoutineService.kt
루틴 단건 조회 API 메서드 및 서비스 추가, RoutineDto→Routine 변환 시 subRoutines 정렬 추가
WriteRoutine 관련 API/Repository/UseCase 구조 정비
.../writeroutine/datasource/WriteRoutineDataSource.kt, .../datasourceImpl/WriteRoutineDataSourceImpl.kt, .../repositoryImpl/WriteRoutineRepositoryImpl.kt, domain/.../writeroutine/repository/WriteRoutineRepository.kt, domain/.../writeroutine/usecase/GetRoutineUseCase.kt
WriteRoutine에서 루틴 단건 조회 관련 메서드 및 use case 제거, register/editRoutine 내부 repeatDay, startTime 처리 서버 명세에 맞게 수정
도메인 계층: Routine/RecommendRoutine 단건 조회 UseCase/Repository 추가
domain/.../recommendroutine/repository/RecommendRoutineRepository.kt, domain/.../recommendroutine/usecase/GetRecommendRoutineUseCase.kt, domain/.../routine/repository/RoutineRepository.kt, domain/.../routine/usecase/GetRoutineUseCase.kt
단일 루틴/추천 루틴 조회용 UseCase 및 Repository 메서드 추가
도메인/프레젠테이션 계층 모델 및 Enum 정비
domain/.../writeroutine/model/RepeatDay.kt, domain/.../writeroutine/model/Time.kt, presentation/.../writeroutine/model/Day.kt, .../model/SubRoutine.kt, .../model/Time.kt
RepeatDay에 fullName 추가, Time 포맷 "HH:mm:00"으로 변경, Day/Time/SubRoutine 변환 메서드 및 상수 서버 명세에 맞게 수정
WriteRoutineViewModel 리팩토링 및 Assisted Injection 도입
presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt
Assisted Injection 기반 생성자 및 Factory 추가, 추천 루틴 기반 등록 로직 추가, repeatDay 처리 방식 서버 명세와 일치화, 전체 초기화/등록/수정 로직 개선

Sequence Diagram(s)

sequenceDiagram
    participant UI as WriteRoutineScreenContainer
    participant VM as WriteRoutineViewModel
    participant Repo as RoutineRepository/RecommendRoutineRepository
    participant DS as RoutineRemoteDataSource/RecommendRoutineDataSource
    participant API as RoutineService/RecommendRoutineService

    UI->>VM: 초기화(WriteRoutineScreenArg 전달)
    alt Add + baseRoutineId 존재
        VM->>Repo: getRecommendRoutine(baseRoutineId)
        Repo->>DS: getRecommendRoutine(baseRoutineId)
        DS->>API: GET /recommend-routines/{id}
        API-->>DS: BaseResponse<RecommendedRoutineDto>
        DS-->>Repo: Result<RecommendedRoutineDto>
        Repo-->>VM: Result<RecommendRoutine>
        VM->>UI: 추천 루틴 정보로 화면 상태 초기화
    else Edit
        VM->>Repo: getRoutine(routineId)
        Repo->>DS: getRoutine(routineId)
        DS->>API: GET /routines/{id}
        API-->>DS: BaseResponse<RoutineDto>
        DS-->>Repo: Result<RoutineDto>
        Repo-->>VM: Result<Routine>
        VM->>UI: 기존 루틴 정보로 화면 상태 초기화
    end
    UI->>VM: 등록/수정 요청
    VM->>Repo: registerRoutine/editRoutine(파라미터 서버 명세 일치화)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
루틴 수정/등록 화면과 단일 루틴/단일 추천 루틴 API 연동 (#49)
현재까지 연동한 API의 request, response를 swagger와 비교한 후 변동 혹은 틀린 부분 수정 (#49)

Assessment against linked issues: Out-of-scope changes

해당 변경사항 중 명시된 이슈(#49) 범위를 벗어난 기능적 코드 변경은 발견되지 않았습니다.

Possibly related PRs

Suggested reviewers

  • wjdrjs00

Poem

🐰

새로운 루틴, 추천도 척척
API 연결, 명세도 딱딱
Assisted로 똑똑하게 ViewModel 주입
서버와 한 몸, 데이터도 깔끔
오늘도 토끼는 코드에 깡총!

( ˘▽˘)っ♬

"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8be01f0 and 94f1300.

📒 Files selected for processing (1)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/service/RecommendRoutineService.kt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/service/RecommendRoutineService.kt
⏰ 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)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#49-write_routine_with_api

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (2)
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (2)

168-186: Null safety 문제 해결 필요

Assisted injection 패턴 도입은 좋은 아키텍처 개선이지만, Line 173에서 routineId!! 사용 시 null safety 문제가 있습니다. Edit 모드에서 routineId가 null일 경우 앱이 크래시될 수 있습니다.

다음과 같이 수정하여 안전성을 개선하세요:

-            val writeScreenNavArg = if (arg.isRegister) {
-                WriteRoutineScreenArg.Add(baseRoutineId = arg.routineId)
-            } else {
-                WriteRoutineScreenArg.Edit(routineId = arg.routineId!!)
-            }
+            val writeScreenNavArg = if (arg.isRegister) {
+                WriteRoutineScreenArg.Add(baseRoutineId = arg.routineId)
+            } else {
+                arg.routineId?.let { routineId ->
+                    WriteRoutineScreenArg.Edit(routineId = routineId)
+                } ?: run {
+                    // Handle error case - navigate back or show error
+                    navigator.navController.popBackStack()
+                    return@composable
+                }
+            }

168-186: 널 안전성 문제가 있습니다.

Line 173에서 arg.routineId!!를 사용하여 강제 언래핑을 하고 있는데, isRegister가 false인 경우에도 routineId가 null일 수 있어 런타임 크래시가 발생할 수 있습니다.

다음과 같이 수정하여 안전하게 처리하세요:

-            val writeScreenNavArg = if (arg.isRegister) {
-                WriteRoutineScreenArg.Add(baseRoutineId = arg.routineId)
-            } else {
-                WriteRoutineScreenArg.Edit(routineId = arg.routineId!!)
-            }
+            val writeScreenNavArg = if (arg.isRegister) {
+                WriteRoutineScreenArg.Add(baseRoutineId = arg.routineId)
+            } else {
+                arg.routineId?.let { routineId ->
+                    WriteRoutineScreenArg.Edit(routineId = routineId)
+                } ?: run {
+                    // 에러 처리 또는 기본값 처리
+                    navigator.navController.popBackStack()
+                    return@composable
+                }
+            }
🧹 Nitpick comments (2)
data/src/main/java/com/threegap/bitnagil/data/recommendroutine/repositoryImpl/RecommendRoutineRepositoryImpl.kt (2)

17-24: 타입 변환 로직은 적절하나 예외 타입 개선 고려

String에서 Int로의 안전한 변환 로직이 올바르게 구현되었습니다. 다만 IllegalArgumentException 대신 비즈니스 도메인에 특화된 예외 타입 사용을 고려해볼 수 있습니다.

예를 들어, 도메인 계층에 InvalidRecommendRoutineIdException 같은 구체적인 예외를 정의하는 것이 더 명확할 수 있습니다.


17-24: 새로운 단일 추천 루틴 조회 메서드가 잘 구현되었습니다.

문자열을 정수로 변환하는 과정에서의 에러 처리가 적절하게 되어 있고, Result 패턴을 올바르게 활용했습니다.

에러 메시지를 더 구체적으로 개선할 수 있습니다:

-            IllegalArgumentException("recommendRoutineId is not a valid integer"),
+            IllegalArgumentException("Invalid recommendRoutineId: '$recommendRoutineId' is not a valid integer"),
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da4e368 and 7818a55.

📒 Files selected for processing (37)
  • app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (3 hunks)
  • core/network/src/main/java/com/threegap/bitnagil/network/model/AuthToken.kt (0 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1 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 (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/model/dto/EmotionDto.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/model/dto/EmotionRecommendedRoutineDto.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/model/response/GetEmotionsResponse.kt (0 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/repositoryImpl/EmotionRepositoryImpl.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/onboarding/datasourceImpl/OnBoardingDataSourceImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/onboarding/model/dto/OnBoardingItemDto.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/onboarding/model/dto/OnBoardingRecommendRoutineDto.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasource/RecommendRoutineDataSource.kt (1 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasourceImpl/RecommendRoutineDataSourceImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/repositoryImpl/RecommendRoutineRepositoryImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/service/RecommendRoutineService.kt (1 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 (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/writeroutine/datasource/WriteRoutineDataSource.kt (0 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/writeroutine/datasourceImpl/WriteRoutineDataSourceImpl.kt (2 hunks)
  • data/src/main/java/com/threegap/bitnagil/data/writeroutine/repositoryImpl/WriteRoutineRepositoryImpl.kt (2 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/recommendroutine/repository/RecommendRoutineRepository.kt (1 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/recommendroutine/usecase/GetRecommendRoutineUseCase.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/GetRoutineUseCase.kt (1 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/RepeatDay.kt (1 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/Time.kt (1 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/repository/WriteRoutineRepository.kt (0 hunks)
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/usecase/GetRoutineUseCase.kt (0 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt (6 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Day.kt (2 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/SubRoutine.kt (2 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt (1 hunks)
💤 Files with no reviewable changes (5)
  • data/src/main/java/com/threegap/bitnagil/data/emotion/model/response/GetEmotionsResponse.kt
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/repository/WriteRoutineRepository.kt
  • data/src/main/java/com/threegap/bitnagil/data/writeroutine/datasource/WriteRoutineDataSource.kt
  • core/network/src/main/java/com/threegap/bitnagil/network/model/AuthToken.kt
  • domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/usecase/GetRoutineUseCase.kt
👮 Files not reviewed due to content moderation or server errors (5)
  • app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
  • data/src/main/java/com/threegap/bitnagil/data/writeroutine/datasourceImpl/WriteRoutineDataSourceImpl.kt
  • data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/repositoryImpl/RecommendRoutineRepositoryImpl.kt
  • data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasourceImpl/RecommendRoutineDataSourceImpl.kt
🧰 Additional context used
🧠 Learnings (4)
domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/Time.kt (1)

Learnt from: l5x5l
PR: #38
File: presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt:14-14
Timestamp: 2025-07-21T10:35:11.387Z
Learning: In the Bitnagil Android project, the AllDay time representation uses Time(hour = 23, minute = 59) as determined by the server and planning teams. This is a business requirement rather than a code design decision.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt (1)

Learnt from: l5x5l
PR: #38
File: presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt:14-14
Timestamp: 2025-07-21T10:35:11.387Z
Learning: In the Bitnagil Android project, the AllDay time representation uses Time(hour = 23, minute = 59) as determined by the server and planning teams. This is a business requirement rather than a code design decision.

data/src/main/java/com/threegap/bitnagil/data/onboarding/model/dto/OnBoardingItemDto.kt (1)

Learnt from: l5x5l
PR: #38
File: presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt:14-14
Timestamp: 2025-07-21T10:35:11.387Z
Learning: In the Bitnagil Android project, the AllDay time representation uses Time(hour = 23, minute = 59) as determined by the server and planning teams. This is a business requirement rather than a code design decision.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.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.

🧬 Code Graph Analysis (6)
data/src/main/java/com/threegap/bitnagil/data/onboarding/datasourceImpl/OnBoardingDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
  • safeUnitApiCall (27-35)
data/src/main/java/com/threegap/bitnagil/data/writeroutine/datasourceImpl/WriteRoutineDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
  • safeUnitApiCall (27-35)
data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasourceImpl/RecommendRoutineDataSourceImpl.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)
  • safeApiCall (10-25)
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.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/writeroutine/WriteRoutineViewModel.kt (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt (1)
  • sendIntent (30-37)
🔇 Additional comments (66)
domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/Time.kt (1)

12-12: 시간 포맷에 초 단위 추가 변경 문제 없음

  • WriteRoutineRepositoryImpl.kt에서 executionTime = startTime.toFormattedString()으로 할당되는 부분 확인
  • RoutineDto.kt의 파싱 로직(executionTime.split(":"))이 분리된 세그먼트를 2개 이상으로 요구하여 “HH:mm”과 “HH:mm:ss” 모두 정상 처리
  • 따라서 고정된 ":00" 추가는 API 명세와 일치하며, 다른 의존 코드는 변경 없이도 올바르게 동작합니다

추가 조치 필요 없습니다. 머지 진행해주세요.

data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1)

21-21: Unit 반환 API 호출 처리 개선

safeApiCall에서 safeUnitApiCall로 변경하여 Unit를 반환하는 API 호출 처리를 표준화했습니다. 같은 클래스의 다른 메서드들과 일관성이 향상되었습니다.

domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model/RepeatDay.kt (1)

3-11: 요일 정보 확장으로 API 명세 대응 개선

각 요일 enum에 fullName 속성을 추가하여 서버 API가 요구하는 전체 요일명을 제공할 수 있게 되었습니다. 기존 enum 값들을 변경하지 않아 하위 호환성이 유지됩니다.

data/src/main/java/com/threegap/bitnagil/data/routine/datasource/RoutineRemoteDataSource.kt (1)

4-4: 단일 루틴 조회 API 인터페이스 추가

단일 루틴 조회를 위한 getRoutine 메서드가 추가되었습니다. 메서드 시그니처가 기존 인터페이스 패턴과 일관성을 유지하며, PR 목표인 단일 루틴 API 연동을 지원합니다.

Also applies to: 11-11

domain/src/main/java/com/threegap/bitnagil/domain/routine/repository/RoutineRepository.kt (1)

3-3: 도메인 계층의 단일 루틴 조회 메서드 추가

도메인 레포지토리에 getRoutine 메서드를 추가하여 단일 루틴 조회 기능을 제공합니다. 도메인 모델(Routine)을 반환하여 Clean Architecture 원칙을 준수합니다.

Also applies to: 11-11

data/src/main/java/com/threegap/bitnagil/data/routine/mapper/RoutineMapper.kt (1)

30-30: 서브 루틴 정렬 로직 추가가 적절합니다.

sortOrder를 기준으로 서브 루틴을 정렬하여 도메인 모델에서 일관된 순서를 보장합니다. API 응답 순서에 관계없이 예측 가능한 데이터 구조를 제공하는 좋은 개선사항입니다.

data/src/main/java/com/threegap/bitnagil/data/routine/service/RoutineService.kt (2)

4-4: 필요한 import가 적절히 추가되었습니다.

새로운 getRoutine 메서드의 반환 타입을 위해 RoutineDto import가 추가되었습니다.


31-34: 단일 루틴 조회 API 엔드포인트가 올바르게 구현되었습니다.

REST API 규칙을 준수하며 기존 API 패턴과 일관성을 유지합니다. BaseResponse<RoutineDto> 반환 타입과 경로 매개변수 사용이 적절합니다.

data/src/main/java/com/threegap/bitnagil/data/routine/datasourceImpl/RoutineRemoteDataSourceImpl.kt (2)

7-7: 필요한 import가 추가되었습니다.

getRoutine 메서드의 반환 타입을 위해 RoutineDto import가 적절히 추가되었습니다.


30-33: 데이터 소스 구현이 기존 패턴을 일관되게 따릅니다.

safeApiCall 래퍼를 사용하여 서비스 계층에 적절히 위임하고 있으며, 클래스 내 다른 메서드들과 동일한 구조를 유지합니다.

data/src/main/java/com/threegap/bitnagil/data/routine/repositoryImpl/RoutineRepositoryImpl.kt (2)

6-6: 도메인 모델 import가 적절히 추가되었습니다.

새로운 getRoutine 메서드의 반환 타입을 위해 Routine 도메인 모델 import가 추가되었습니다.


25-26: 리포지토리 구현이 올바른 패턴을 따릅니다.

데이터 소스에 적절히 위임하고 toDomain() 매퍼를 사용하여 DTO를 도메인 모델로 변환합니다. 클래스 내 다른 메서드들과 일관된 구조를 유지합니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt (2)

3-3: 감정 API 응답 구조 개선을 위한 import 변경이 적절합니다.

GetEmotionsResponse 래퍼 클래스 대신 EmotionDto를 직접 사용하여 응답 구조를 단순화합니다.


13-13: API 응답 타입 단순화가 잘 구현되었습니다.

BaseResponse<List<EmotionDto>> 구조로 변경하여 불필요한 래퍼 클래스를 제거하고 더 직관적인 API 구조를 제공합니다. 서버 API 명세와의 일치를 위한 개선사항입니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt (1)

3-3: API 응답 구조 단순화 개선사항

GetEmotionsResponse 래퍼를 제거하고 List<EmotionDto>를 직접 반환하도록 변경한 것은 좋은 개선사항입니다. 불필요한 래퍼 객체를 제거하여 코드가 더 간결해졌습니다.

Also applies to: 7-7

data/src/main/java/com/threegap/bitnagil/data/onboarding/datasourceImpl/OnBoardingDataSourceImpl.kt (1)

4-4: Unit 반환 API 호출을 위한 적절한 래퍼 사용

safeApiCall에서 safeUnitApiCall로 변경한 것이 적절합니다. 이 메서드가 Result<Unit>을 반환하므로 Unit 전용 래퍼를 사용하는 것이 타입 안전성과 일관성 측면에서 더 좋습니다.

Also applies to: 55-55

domain/src/main/java/com/threegap/bitnagil/domain/recommendroutine/repository/RecommendRoutineRepository.kt (1)

3-3: 단일 추천 루틴 조회 메서드 추가

기존 fetchRecommendRoutines() 메서드를 보완하는 단일 루틴 조회 메서드가 적절히 추가되었습니다. 메서드 시그니처가 기존 패턴과 일관성 있게 구성되어 있습니다.

Also applies to: 8-8

data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasource/RecommendRoutineDataSource.kt (1)

4-4: 데이터 소스 메서드 추가 및 매개변수 타입 확인

단일 추천 루틴 조회를 위한 데이터 소스 메서드가 적절히 추가되었습니다. 도메인 레포지토리에서는 String 타입의 ID를 사용하는 반면, 여기서는 Int 타입을 사용하고 있어 중간에 변환 로직이 있을 것으로 보입니다.

Also applies to: 8-8

data/src/main/java/com/threegap/bitnagil/data/onboarding/model/dto/OnBoardingItemDto.kt (1)

20-20: 기존 로직과 호환 확인 완료

OnBoardingDataSourceImpl에서

  • OnBoardingItemDto.Morning.id
  • OnBoardingItemDto.Evening.id
  • OnBoardingItemDto.Nothing.id
    를 직접 참조해 분기 처리를 하고 있으며,
    기존 문자열 리터럴("MORNING", "EVENING", "NOTHING")에 대한 참조도 전혀 남아 있지 않습니다.
    따라서 HH:mm:ss 포맷으로의 ID 변경은 로직에 전혀 영향을 주지 않으므로 추가 수정은 필요하지 않습니다.
domain/src/main/java/com/threegap/bitnagil/domain/routine/usecase/GetRoutineUseCase.kt (1)

1-12: 깔끔한 도메인 유즈케이스 구현입니다.

단일 책임 원칙을 잘 따르고 있으며, 의존성 주입과 Result 타입을 통한 에러 핸들링이 적절하게 구현되어 있습니다. 리포지토리 계층에 대한 단순한 위임 패턴도 유즈케이스의 역할에 맞습니다.

data/src/main/java/com/threegap/bitnagil/data/writeroutine/repositoryImpl/WriteRoutineRepositoryImpl.kt (2)

19-19: RepeatDay 매핑 방식 변경이 적절합니다.

name에서 fullName으로 변경하여 API 명세와 일치하도록 개선되었습니다.


36-37: 반복 일자와 시간 포맷팅 개선

RepeatDay.fullName 사용과 toFormattedString() 메서드 사용으로 API 요청 형식이 서버 명세와 일치하도록 통일되었습니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/model/dto/EmotionDto.kt (1)

6-14: 감정 DTO 구조가 잘 설계되었습니다.

@Serializable@SerialName 어노테이션을 적절히 사용하여 JSON 직렬화/역직렬화를 위한 구조가 명확합니다. 불변 속성 사용과 단순한 데이터 컨테이너 역할이 DTO의 목적에 부합합니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/repositoryImpl/EmotionRepositoryImpl.kt (1)

13-14: 감정 데이터 매핑 로직 개선

GetEmotionsResponse 래퍼 클래스에서 직접적인 List<EmotionDto> 사용으로 변경되어 구조가 단순화되었습니다. mapNotNull을 사용하여 인식되지 않는 감정 타입을 안전하게 필터링하는 것도 적절합니다.

data/src/main/java/com/threegap/bitnagil/data/recommendroutine/service/RecommendRoutineService.kt (2)

4-4: 필요한 import 추가

RecommendedRoutineDto import가 새로운 API 메서드를 위해 적절히 추가되었습니다.


13-14: 단일 추천 루틴 조회 API 엔드포인트 추가

REST API 패턴을 잘 따르고 있으며, 기존 fetchRecommendRoutines 메서드와 일관된 구조로 구현되었습니다. 경로 매개변수와 반환 타입이 적절하게 설정되어 있습니다.

app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (4)

5-5: 적절한 import 추가

새로운 assisted injection 패턴을 지원하기 위한 필요한 import들이 올바르게 추가되었습니다.

Also applies to: 19-20


176-181: Assisted injection 패턴 올바른 구현

hiltViewModel 팩토리를 사용하여 WriteRoutineScreenArg를 ViewModel에 전달하는 방식이 올바르게 구현되었습니다. 이는 깔끔한 의존성 주입 패턴을 따르고 있습니다.


168-174: Edit 모드에서 arg.routineId!! 언랩핑은 안전합니다

Edit 모드 진입 시 항상 non-null routineId를 전달하고 있음을 확인했습니다.

  • app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
    navigator.navController.navigate(Route.WriteRoutine(routineId = routineId, isRegister = false))

따라서 추가적인 null 체크 로직은 필요하지 않습니다.


5-5: 아키텍처 개선을 위한 적절한 import 추가

Assisted injection 패턴 구현을 위한 필요한 import들이 올바르게 추가되었습니다.

Also applies to: 19-20

data/src/main/java/com/threegap/bitnagil/data/writeroutine/datasourceImpl/WriteRoutineDataSourceImpl.kt (6)

3-3: Unit 반환 API 호출에 적합한 함수 사용

safeUnitApiCall 사용은 Unit을 반환하는 API 호출에 더 적합하며, 불필요한 제네릭 타입 처리를 피할 수 있습니다.


14-14: API 호출 래퍼 함수 올바른 사용

Unit을 반환하는 API 호출에 safeUnitApiCall을 사용하는 것이 의미론적으로 더 정확하고 명확합니다.

Also applies to: 20-20


3-3: Unit 반환 메서드에 적합한 import 변경

safeUnitApiCall로의 import 변경이 적절합니다. Unit을 반환하는 API 호출에 맞는 래퍼 함수를 사용하고 있습니다.


14-14: Unit 반환 메서드에 올바른 API 래퍼 사용

registerRoutineeditRoutine 메서드에서 safeUnitApiCall 사용이 적절합니다. 데이터를 반환하지 않는 API 호출에 맞는 래퍼 함수를 사용하고 있어 타입 안전성이 향상되었습니다.

Also applies to: 20-20


13-17: API 호출 래퍼 개선이 적절합니다.

safeApiCall에서 safeUnitApiCall로 변경한 것이 올바릅니다. Unit을 반환하는 API 호출에 특화된 래퍼를 사용하여 타입 안전성과 코드 명확성을 향상시켰습니다.


19-23: API 호출 래퍼 개선이 적절합니다.

마찬가지로 editRoutine 메서드에서도 safeUnitApiCall 사용이 적절합니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt (5)

5-5: 데이터 구조 단순화를 위한 적절한 import 변경

래퍼 객체 제거하고 직접적인 DTO 리스트를 사용하는 구조로의 변경이 올바르게 reflected되었습니다.


14-14: 래퍼 객체 제거로 인한 올바른 반환 타입 변경

Result<List<EmotionDto>>로의 변경은 불필요한 래퍼 객체를 제거하고 더 직접적인 데이터 구조를 사용하는 좋은 리팩토링입니다.


5-5: 불필요한 래퍼 제거를 위한 적절한 import 변경

GetEmotionsResponse 래퍼 대신 EmotionDto를 직접 사용하는 것은 데이터 구조를 단순화하는 좋은 리팩터링입니다.


14-14: 데이터 구조 단순화를 통한 개선

응답 래퍼 객체를 제거하고 List<EmotionDto>를 직접 반환하는 것은 데이터 플로우를 단순화하고 불필요한 중첩을 제거하는 좋은 개선사항입니다.


14-18: 반환 타입 단순화가 적절합니다.

GetEmotionsResponse 래퍼 객체를 제거하고 List<EmotionDto>를 직접 반환하도록 변경한 것은 좋은 아키텍처 개선입니다. 불필요한 래퍼 객체를 제거하여 코드를 단순화했습니다.

data/src/main/java/com/threegap/bitnagil/data/recommendroutine/repositoryImpl/RecommendRoutineRepositoryImpl.kt (3)

5-5: 필요한 도메인 모델 import 추가

새로운 getRecommendRoutine 메서드의 반환 타입으로 필요한 import가 올바르게 추가되었습니다.


5-5: 새 메서드를 위한 필요한 import 추가

RecommendRoutine 도메인 모델 import가 새로 추가된 getRecommendRoutine 메서드를 위해 적절히 추가되었습니다.


17-24: 안전한 ID 변환과 적절한 에러 처리

String ID를 Int로 변환하는 로직이 잘 구현되었습니다:

  • toIntOrNull()을 사용한 안전한 변환
  • 의미있는 에러 메시지와 함께 실패 케이스 처리
  • 도메인 모델로의 적절한 매핑
data/src/main/java/com/threegap/bitnagil/data/recommendroutine/datasourceImpl/RecommendRoutineDataSourceImpl.kt (5)

6-6: 필요한 DTO import 추가

새로운 메서드의 반환 타입으로 필요한 RecommendedRoutineDto import가 올바르게 추가되었습니다.


19-22: 일관된 패턴의 올바른 구현

기존 fetchRecommendRoutines 메서드와 동일한 패턴을 사용하여 safeApiCall로 API 호출을 래핑하는 일관된 구현입니다.


6-6: 새 메서드를 위한 필요한 DTO import 추가

RecommendedRoutineDto import가 새로 추가된 getRecommendRoutine 메서드의 반환 타입을 위해 적절히 추가되었습니다.


19-22: 기존 패턴을 따르는 일관된 구현

새로 추가된 getRecommendRoutine 메서드가 기존 fetchRecommendRoutines 메서드와 일관된 패턴으로 구현되었습니다:

  • safeApiCall을 사용한 표준화된 에러 처리
  • 서비스 레이어로의 적절한 위임
  • 인터페이스 계약에 맞는 메서드 시그니처

19-22: 새로운 데이터 소스 메서드가 일관성 있게 구현되었습니다.

기존 fetchRecommendRoutines 메서드와 동일한 패턴으로 safeApiCall 래퍼를 사용하여 일관성을 유지했습니다. 구현이 깔끔하고 적절합니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Day.kt (2)

3-3: 새로운 도메인 모델 import 확인

DayOfWeekdomain.routine.model에서 가져오도록 변경되었습니다. 이는 도메인 모델의 표준화를 위한 좋은 변경으로 보입니다.


29-38: fromRepeatDay 사용처 모두 fromDayOfWeek로 대체됨 확인

fromDayOfWeek 메서드의 매핑 로직이 표준 요일 순서와 일치하며, 기존 fromRepeatDay 호출이 리포지토리 내에 더 이상 남아있지 않음을 확인했습니다. 추가 조치 없이 이대로 머지 가능합니다.

data/src/main/java/com/threegap/bitnagil/data/onboarding/model/dto/OnBoardingRecommendRoutineDto.kt (2)

13-16: 서버 API 명세와 일치하도록 속성명 변경

routineDescriptionrecommendedRoutineDescription, recommendedSubRoutinesrecommendedSubRoutineSearchResult로 변경되어 서버 API 명세와 일치하도록 수정되었습니다. 이는 PR 목표와 일치하는 좋은 변경입니다.


22-22: 변환 메서드 업데이트 확인

새로운 속성명 recommendedRoutineDescription을 사용하도록 변환 메서드가 올바르게 업데이트되었습니다.

domain/src/main/java/com/threegap/bitnagil/domain/recommendroutine/usecase/GetRecommendRoutineUseCase.kt (1)

7-12: 클린한 유즈케이스 구현

단일 추천 루틴 조회를 위한 유즈케이스가 클린 아키텍처 원칙에 따라 잘 구현되었습니다. 의존성 주입, Result 타입을 통한 에러 핸들링, 리포지토리로의 단순한 위임 구조가 적절합니다.

data/src/main/java/com/threegap/bitnagil/data/emotion/model/dto/EmotionRecommendedRoutineDto.kt (1)

12-15: OnBoardingRecommendRoutineDto와 일관성 있는 속성명 변경

감정 기반 추천 루틴 DTO도 온보딩 DTO와 동일하게 속성명이 변경되어 일관성이 확보되었습니다. 서버 API 명세와의 일치를 위한 적절한 변경입니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Time.kt (2)

21-28: 안전한 시간 문자열 파싱 구현

fromDomainTimeString 메서드가 예외 처리와 함께 잘 구현되었습니다. "HH:mm" 형식의 문자열을 파싱하고 실패 시 기본값(12:00)으로 fallback하는 로직이 안전합니다.


19-19: AllDay 시간 표현 변경 확인 요청

현재 AllDay 값이 기존 Time(hour = 23, minute = 59)에서 Time(hour = 0, minute = 0)으로 변경되었습니다.
이전 서버·기획팀 요구사항에서는 하루를 끝내는 시각으로 23:59를 사용하도록 정의되어 있었으므로, 이번 변경이 의도된 비즈니스 로직 수정인지 확인이 필요합니다.

검토 사항:

  • 기획/서버 API 명세 상 AllDay 시간 표현 변경 내역 유무
  • 관련 문서(요구사항 정의서, API 스펙) 업데이트 여부

위 사항을 기획·백엔드팀과 함께 검증 후 결과를 공유해 주세요.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/SubRoutine.kt (3)

2-3: 도메인 모델 구조 변경이 적절합니다.

도메인 모델 재구조화에 따른 import 변경이 PR 목표에 부합합니다. SubRoutinewriteroutine에서 routine 도메인으로 이동하고, 추천 루틴 기능을 위한 RecommendSubRoutine import가 추가되었습니다.


10-15: API 명세에 맞춘 필드 매핑 변경이 적절합니다.

id/name에서 subRoutineId/subRoutineName으로의 필드 매핑 변경은 서버 API 명세와의 일치를 위한 필수적인 수정입니다.


17-22: 추천 서브루틴 변환 메서드 추가가 적절합니다.

추천 루틴 기능 지원을 위한 새로운 팩토리 메서드입니다. id를 Int에서 String으로 변환하는 처리가 포함되어 있어 도메인 모델 간의 타입 차이를 적절히 처리합니다.

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt (6)

5-46: Assisted Injection 패턴 적용이 적절합니다.

네비게이션 인자 전달을 위한 Dagger Assisted Injection 구현이 올바르게 되어 있습니다. SavedStateHandle에서 인자를 추출하는 방식에서 타입 안전한 WriteRoutineScreenArg 주입 방식으로 개선되었습니다.


50-53: 초기화 로직 단순화가 개선되었습니다.

주입된 writeRoutineArg를 직접 사용하여 더 명확하고 타입 안전한 초기화가 가능해졌습니다.


62-65: 추천 루틴 로드 로직이 올바르게 구현되었습니다.

baseRoutineId가 있는 경우 loadRecommendRoutine을 호출하도록 변경된 것이 적절합니다. 이는 추천 루틴 기반 등록 화면을 위한 올바른 구현입니다.


80-100: 루틴 로드 로직의 아키텍처 개선이 적절합니다.

Repository 직접 호출에서 UseCase 사용으로 변경되어 클린 아키텍처 원칙을 따릅니다. SetRoutine 인텐트를 통해 도메인 모델을 프레젠테이션 모델로 적절히 매핑합니다.


102-122: 추천 루틴 로드 메서드가 적절히 구현되었습니다.

추천 루틴 조회를 위한 새로운 메서드입니다. repeatDays를 빈 리스트로 설정하는 것은 추천 루틴에는 반복 일정이 미리 정의되지 않기 때문에 적절합니다.


340-357: 반복 요일 처리 로직이 명확하게 개선되었습니다.

when 표현식을 사용하여 각 RepeatType에 대한 처리가 명시적으로 구분됩니다:

  • DAILY: 모든 요일
  • DAY: 선택된 요일만 필터링
  • null: 조기 반환

이로 인해 코드 가독성과 유지보수성이 향상되었습니다.

l5x5l added 2 commits July 30, 2025 16:47
…rite_routine_with_api

# Conflicts:
#	data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt
#	data/src/main/java/com/threegap/bitnagil/data/emotion/datasourceImpl/EmotionDataSourceImpl.kt
#	data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt
#	data/src/main/java/com/threegap/bitnagil/data/routine/datasource/RoutineRemoteDataSource.kt
#	data/src/main/java/com/threegap/bitnagil/data/routine/datasourceImpl/RoutineRemoteDataSourceImpl.kt
#	data/src/main/java/com/threegap/bitnagil/data/routine/repositoryImpl/RoutineRepositoryImpl.kt
#	data/src/main/java/com/threegap/bitnagil/data/routine/service/RoutineService.kt
#	domain/src/main/java/com/threegap/bitnagil/domain/routine/repository/RoutineRepository.kt
Copy link
Member

@wjdrjs00 wjdrjs00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨슴다! 리뷰 확인해주세요~!

@wjdrjs00 wjdrjs00 self-requested a review July 30, 2025 09:02
Copy link
Member

@wjdrjs00 wjdrjs00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어려운 분기처리,, 고생하셨습니다요!

@l5x5l l5x5l merged commit cfc7f70 into develop Jul 30, 2025
2 checks passed
@l5x5l l5x5l deleted the feature/#49-write_routine_with_api branch July 30, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 새로운 기능 구현 세환 🐞 Fix 버그 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] 단일 루틴/단일 추천 루틴 API 연결 및 기존 API 호출부 점검
2 participants