Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class TodayBriefingController {

@Operation(
summary = "오늘의 브리핑 조회",
description = "홈 화면에 표시할 오늘의 브리핑을 최대 3건까지 조회합니다. 브리핑은 일정과 최근 주요 알림 데이터를 조합해 반환합니다."
description = "홈 화면에 표시할 오늘의 브리핑을 최대 3건까지 조회합니다. 오늘 일정, 여러 날 일정의 마감 당일, 일정 시작 D-1/D-3 알림과 최근 24시간 주요 알림을 정책 우선순위 기준으로 조합해 반환합니다."
)
@GetMapping("/today")
public ApiResponse<TodayBriefingResponse> getTodayBriefings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
public enum TodayBriefingType {

TODAY_SCHEDULE(1),
SCHEDULE_START_REMINDER(2),
RECRUITMENT_APPLIED(3),
SCHEDULE_CREATED(4),
NOTICE_CREATED(5),
FILE_UPLOADED(6),
VIDEO_FEEDBACK_COMMENTED(7);
SCHEDULE_DUE_TODAY(2),
SCHEDULE_START_REMINDER(3),
RECRUITMENT_APPLIED(4),
SCHEDULE_CREATED(5),
NOTICE_CREATED(6),
FILE_UPLOADED(7),
VIDEO_FEEDBACK_COMMENTED(8);

private final int priority;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ List<Notification> findRecentNotificationsByCursor(
and n.type in :types
order by
case
when n.type = :recruitmentAppliedType then 3
when n.type = :scheduleCreatedType then 4
when n.type = :noticeCreatedType then 5
when n.type = :fileUploadedType then 6
when n.type = :videoFeedbackCommentedType then 7
when n.type = :recruitmentAppliedType then 4
when n.type = :scheduleCreatedType then 5
when n.type = :noticeCreatedType then 6
when n.type = :fileUploadedType then 7
when n.type = :videoFeedbackCommentedType then 8
else 999
end,
n.updatedAt desc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void addTodayScheduleBriefings(

schedules.forEach(schedule -> {
candidates.add(BriefingCandidate.builder()
.type(TodayBriefingType.TODAY_SCHEDULE)
.type(getTodayScheduleBriefingType(schedule, today))
.content(buildTodayScheduleContent(schedule, today))
.projectId(getProjectId(schedule.getProject()))
.targetType(NotificationTargetType.SCHEDULE.name())
Expand Down Expand Up @@ -176,7 +176,7 @@ private BriefingCandidate toNotificationCandidate(Notification notification) {
private String buildTodayScheduleContent(Schedule schedule, LocalDate today) {
String title = schedule.getTitle();
String projectTitle = getProjectTitle(schedule.getProject());
String actionText = isMultiDaySchedule(schedule) && isScheduleEndDate(schedule, today)
String actionText = isScheduleDueToday(schedule, today)
? "마감이에요"
: "일정이 있어요";

Expand All @@ -186,6 +186,17 @@ private String buildTodayScheduleContent(Schedule schedule, LocalDate today) {
return "[" + projectTitle + "] 오늘 [" + title + "] " + actionText;
}

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);
}
Comment on lines +189 to +198

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ 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' . || true

Repository: 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
done

Repository: SLAT-TO/SLATE-TO-BE

Length of output: 21550


마감일 계산에서 endAt 포함 여부를 명시하세요.

findBriefingAssignedSchedulesBetweens.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.


private String buildStartReminderContent(Schedule schedule, int dayOffset) {
String title = schedule.getTitle();
String projectTitle = getProjectTitle(schedule.getProject());
Expand All @@ -198,11 +209,16 @@ private String buildStartReminderContent(Schedule schedule, int dayOffset) {
}

private boolean isScheduleEndDate(Schedule schedule, LocalDate date) {
return schedule.getEndAt().toLocalDate().isEqual(date);
return getInclusiveEndDate(schedule).isEqual(date);
}

private boolean isMultiDaySchedule(Schedule schedule) {
return !schedule.getStartAt().toLocalDate().isEqual(schedule.getEndAt().toLocalDate());
return !schedule.getStartAt().toLocalDate().isEqual(getInclusiveEndDate(schedule));
}

private LocalDate getInclusiveEndDate(Schedule schedule) {
// endAt은 종료 경계값이므로 00:00 종료 일정은 전날까지 진행된 일정으로 본다.
return schedule.getEndAt().minusNanos(1).toLocalDate();
}

private Long getProjectId(Project project) {
Expand Down
Loading