Repository navigation
Conversation
PLANNING -> IN_PROGRESS 전이 로직이 없어 투데이 코스 조회가 항상 비어 있고, 홈의 진행중 목록/배너도 오늘 코스를 인식하지 못하던 문제 수정. - Course.start()로 PLANNING -> IN_PROGRESS 전이 추가 - 오늘 날짜 코스를 승격시키는 공용 헬퍼 TodayCoursePromoter 추가 - 홈(getCourses)/투데이(getTodayCourse) 조회 진입 시 동일 규칙으로 승격 - CourseRepository 쿼리를 상태 컬렉션(in) 기반으로 변경
📝 WalkthroughWalkthroughThe course flow now promotes today’s planning courses to ChangesCourse promotion and retrieval
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant CourseService
participant TodayCoursePromoter
participant CourseRepository
participant Course
Client->>CourseService: request courses
CourseService->>TodayCoursePromoter: promoteDueCourses(userId, today)
TodayCoursePromoter->>CourseRepository: find today’s PLANNING courses
CourseRepository-->>TodayCoursePromoter: return joined courses
TodayCoursePromoter->>Course: start()
Course-->>TodayCoursePromoter: set IN_PROGRESS
CourseService->>CourseRepository: retrieve courses
CourseRepository-->>CourseService: return course data
CourseService-->>Client: return courses
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/java/com/daytodo/domain/course/service/CourseServiceTest.java (1)
73-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winVerify the promotion call in a
getCoursestest.The mock only satisfies constructor injection. Add an assertion that
getCoursescallstodayCoursePromoter.promoteDueCourses(1L, TODAY)before it loads in-progress courses. This protects the new home-flow integration from regression.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/daytodo/domain/course/service/CourseServiceTest.java` around lines 73 - 92, Update a getCourses test in CourseServiceTest to verify todayCoursePromoter.promoteDueCourses(1L, TODAY) is invoked before loading in-progress courses, using the existing todayCoursePromoter mock and appropriate interaction-order verification.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/com/daytodo/domain/course/service/TodayCourseService.java`:
- Around line 46-54: Update TodayCourseService to inject the shared Clock used
by CourseService, then replace the LocalDate.now() call in getTodayCourse with
LocalDate.now(clock) so promotion and course lookup use the same business date.
---
Nitpick comments:
In `@src/test/java/com/daytodo/domain/course/service/CourseServiceTest.java`:
- Around line 73-92: Update a getCourses test in CourseServiceTest to verify
todayCoursePromoter.promoteDueCourses(1L, TODAY) is invoked before loading
in-progress courses, using the existing todayCoursePromoter mock and appropriate
interaction-order verification.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5cf40f33-f665-43d1-88e0-e301e9796ae1
📒 Files selected for processing (7)
src/main/java/com/daytodo/domain/course/entity/Course.javasrc/main/java/com/daytodo/domain/course/repository/CourseRepository.javasrc/main/java/com/daytodo/domain/course/service/CourseService.javasrc/main/java/com/daytodo/domain/course/service/TodayCoursePromoter.javasrc/main/java/com/daytodo/domain/course/service/TodayCourseService.javasrc/test/java/com/daytodo/domain/course/repository/CourseQueryValidationTest.javasrc/test/java/com/daytodo/domain/course/service/CourseServiceTest.java
📌 관련 이슈
🔎 What is this PR?
투데이 코스 조회와 홈 진행중 코스가 오늘 날짜 코스를 인식하지 못하던 문제를 수정했습니다.
코스 상태가 PLANNING → IN_PROGRESS로 전이되는 로직이 없어 발생한 이슈로, 조회 시점 지연 승격 방식으로 해결했습니다.
✨ Changes
문제
해결 — 조회 시점 지연 승격
참고
📷 Result
💬 To. Reviewer
✅ 체크 리스트