fix: 오늘의 브리핑 정책 우선순위 보정 - #141
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough오늘의 브리핑이 여러 날 일정의 마감 당일을 Changes오늘의 브리핑 정책
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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/main/java/com/slatto/domain/notification/service/TodayBriefingService.java (1)
189-198: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win새 분류 규칙을 회귀 테스트로 고정하세요.
다음 경우를 테스트에 추가하세요.
- 같은 날짜의 일정:
TODAY_SCHEDULE,일정이 있어요- 오늘 종료하는 다일 일정:
SCHEDULE_DUE_TODAY,마감이에요- 다른 날짜에 종료하는 다일 일정:
TODAY_SCHEDULE,일정이 있어요전체 결과의 우선순위와 최대 3건 제한도 함께 검증하세요.
🤖 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/main/java/com/slatto/domain/notification/service/TodayBriefingService.java` around lines 189 - 198, TodayBriefingService의 getTodayScheduleBriefingType 분류 규칙에 대한 회귀 테스트를 추가하세요. 같은 날짜 일정은 TODAY_SCHEDULE와 “일정이 있어요”, 오늘 종료하는 다일 일정은 SCHEDULE_DUE_TODAY와 “마감이에요”, 다른 날짜에 종료하는 다일 일정은 TODAY_SCHEDULE와 “일정이 있어요”가 되도록 검증하고, 여러 일정이 섞인 경우 전체 결과의 우선순위와 최대 3건 제한도 함께 확인하세요.
🤖 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/slatto/domain/notification/service/TodayBriefingService.java`:
- Around line 189-198: Clarify the deadline calculation used by
isScheduleEndDate and align it with the intended definition that the final
working time, not merely the endAt calendar date, determines the deadline. If
the deadline should differ from endAt, use the existing or appropriate
deadlineAt value; otherwise adjust the comparison so schedules ending at the
next day’s 00:00 are not classified as due today.
---
Nitpick comments:
In
`@src/main/java/com/slatto/domain/notification/service/TodayBriefingService.java`:
- Around line 189-198: TodayBriefingService의 getTodayScheduleBriefingType 분류 규칙에
대한 회귀 테스트를 추가하세요. 같은 날짜 일정은 TODAY_SCHEDULE와 “일정이 있어요”, 오늘 종료하는 다일 일정은
SCHEDULE_DUE_TODAY와 “마감이에요”, 다른 날짜에 종료하는 다일 일정은 TODAY_SCHEDULE와 “일정이 있어요”가 되도록
검증하고, 여러 일정이 섞인 경우 전체 결과의 우선순위와 최대 3건 제한도 함께 확인하세요.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a7364282-83a2-41ed-8077-75bfbfbb0318
📒 Files selected for processing (4)
src/main/java/com/slatto/domain/notification/controller/TodayBriefingController.javasrc/main/java/com/slatto/domain/notification/enums/TodayBriefingType.javasrc/main/java/com/slatto/domain/notification/repository/NotificationRepository.javasrc/main/java/com/slatto/domain/notification/service/TodayBriefingService.java
| private TodayBriefingType getTodayScheduleBriefingType(Schedule schedule, LocalDate today) { | ||
| if (isScheduleDueToday(schedule, today)) { | ||
| return TodayBriefingType.SCHEDULE_DUE_TODAY; | ||
| } | ||
| return TodayBriefingType.TODAY_SCHEDULE; | ||
| } | ||
|
|
||
| private boolean isScheduleDueToday(Schedule schedule, LocalDate today) { | ||
| return isMultiDaySchedule(schedule) && isScheduleEndDate(schedule, today); | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 10 \
'findBriefingAssignedSchedulesBetween|findBriefingAssignedSchedulesStartingBetween' \
--glob '*.java'
rg -n -C 8 \
'getEndAt\(\)|setEndAt\(|endAt' \
--glob '*.java'Repository: SLAT-TO/SLATE-TO-BE
Length of output: 157
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Repository files around notification/schema:"
git ls-files | sed -n '1,200p'
echo
echo "Find TodayBriefingService:"
fd -a 'TodayBriefingService\.java$' . || true
echo
echo "Find Schedule-related files:"
fd -ai 'Schedule.*\.java$|.*Schedule.*\.java$' . || true
echo
echo "Search for briefing schedule methods broadly:"
rg -n -C 8 'BriefingAssignedSchedules|findBriefing|AssignedSchedules|SCHEDULE_DUE_TODAY|TODAY_SCHEDULE|isScheduleDueToday|isScheduleEndDate|isMultiDaySchedule' . || trueRepository: SLAT-TO/SLATE-TO-BE
Length of output: 38145
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "TodayBriefingService relevant section:"
sed -n '60,220p' src/main/java/com/slatto/domain/notification/service/TodayBriefingService.java
echo
echo "ScheduleRepository relevant queries:"
sed -n '25,106p' src/main/java/com/slatto/domain/schedule/repository/ScheduleRepository.java
echo
echo "Schedule entity:"
sed -n '1,220p' src/main/java/com/slatto/domain/schedule/entity/Schedule.java
echo
echo "Schedule DTOs with dates:"
for f in \
src/main/java/com/slatto/domain/schedule/dto/ScheduleCreateRequest.java \
src/main/java/com/slatto/domain/schedule/dto/ScheduleUpdateRequest.java \
src/main/java/com/slatto/domain/schedule/dto/ScheduleDailyResponse.java \
src/main/java/com/slatto/domain/schedule/dto/ScheduleCalendarResponse.java \
src/main/java/com/slatto/domain/schedule/dto/ScheduleResponse.java
do
if [ -f "$f" ]; then
echo "--- $f"
sed -n '1,220p' "$f"
fi
doneRepository: SLAT-TO/SLATE-TO-BE
Length of output: 21550
마감일 계산에서 endAt 포함 여부를 명시하세요.
findBriefingAssignedSchedulesBetween는 s.endAt >= :startAt로 종료 시각이 시작 시각 포함입니다. isScheduleEndDate()가 schedule.getEndAt().toLocalDate().isEqual(date)로 비교하므로, 다음날 00:00에 끝나는 장기 일정도 오늘 마감으로 분류됩니다. 마감일 정의가 최종 작업 시간이 포함되는 endAt 기준이라면 이 값은 정리하고, 별도 deadlineAt을 사용하세요.
🤖 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/main/java/com/slatto/domain/notification/service/TodayBriefingService.java`
around lines 189 - 198, Clarify the deadline calculation used by
isScheduleEndDate and align it with the intended definition that the final
working time, not merely the endAt calendar date, determines the deadline. If
the deadline should differ from endAt, use the existing or appropriate
deadlineAt value; otherwise adjust the comparison so schedules ending at the
next day’s 00:00 are not classified as due today.
🔗 관련 이슈 (Related Issue)
Closes #140
📝 작업 내용
오늘의 브리핑 조회 API가 최신 정책서 기준과 일치하도록 브리핑 타입, 문구, 우선순위 정렬 기준을 보정했습니다.
오늘의 브리핑은 별도 테이블을 만들지 않고 기존
schedule,notification데이터를 조합해 조회합니다.주요 변경 사항
구현 API
GET /api/v1/briefings/today
브리핑 우선순위
일정 브리핑 문구 기준
[{프로젝트명}] 오늘 [{일정명}] 일정이 있어요[{프로젝트명}] 오늘 [{일정명}] 일정이 있어요[{프로젝트명}] 오늘 [{일정명}] 마감이에요[{프로젝트명}] [{일정명}] 시작까지 D-{N}조회 기준
✅ PR 체크리스트
테스트
./gradlew testSummary by CodeRabbit
새 기능
개선 사항