Skip to content

feat: 개인 알림 도메인 이벤트 연결 - #138

Merged
guingguing merged 8 commits into
developfrom
feature/127-notification-domain-connections
Aug 6, 2026
Merged

feat: 개인 알림 도메인 이벤트 연결#138
guingguing merged 8 commits into
developfrom
feature/127-notification-domain-connections

Conversation

@guingguing

@guingguing guingguing commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔗 관련 이슈 (Related Issue)

Closes #127

📝 작업 내용

개인 알림 생성 메서드를 실제 도메인 이벤트에 연결하고, 정책서 기준에 맞춰 알림 문구를 정리했습니다.

각 도메인에서는 NotificationService의 알림 생성 메서드만 호출하도록 구성했고, 알림 제목과 본문 생성은 알림 도메인에서 담당하도록 정리했습니다.

주요 변경 사항

  • 프로젝트 합류 알림 연결
  • 일정 생성 알림 연결
  • 공지 등록 알림 연결
  • 파일 등록 알림 연결
  • 피드백/답글 알림 연결 확인
  • 지원자 발생 알림 연결 확인
  • 개인 알림 문구를 정책서 기준으로 정리
  • 알림 대상자 조회 및 중복 수신 방지 처리
  • 알림 생성 흐름 관련 테스트 보강

구현된 개인 알림

트리거 알림 타입 그룹핑 여부
일정 담당자 지정 SCHEDULE_ASSIGNED 없음
프로젝트 합류 PROJECT_JOINED 없음
영상 피드백/답글 등록 VIDEO_FEEDBACK_COMMENTED 동일 영상 기준 그룹핑
새로운 지원자 발생 RECRUITMENT_APPLIED 동일 공고 기준 그룹핑
새로운 일정 등록 SCHEDULE_CREATED 없음
공지 등록 NOTICE_CREATED 없음
파일 등록 FILE_UPLOADED 없음

알림 문구 기준

정책서 기준에 맞춰 알림 title, content를 알림 도메인 내부에서 생성하도록 정리했습니다.

  • 일정 담당자 지정: {사용자명}님이 [{일정명}] 담당자로 지명되었어요.
  • 프로젝트 합류: {합류자명}님이 프로젝트에 합류했어요.
  • 영상 피드백: {작성자명}님이 [{영상명}]에 새로운 피드백을 남겼어요.
  • 영상 피드백 그룹핑: [{영상명}]에 새로운 피드백 {N}건이 등록되었어요.
  • 새로운 지원자: {지원자명}님이 [{공고명}]에 지원했어요.
  • 새로운 지원자 그룹핑: [{공고명}]에 새로운 지원자 {N}명이 지원했어요.
  • 새로운 일정 등록: {등록자명}님이 [{일정명}] 일정을 등록했어요.
  • 공지 등록: {등록자명}님이 새 공지를 등록했어요: {공지 제목}.
  • 파일 등록: {등록자명}님이 [{파일명}] 파일을 등록했어요.

참고 사항

  • 파일 등록 알림은 현재 다중 파일 업로드 기능이 없어 그룹핑하지 않도록 처리했습니다.
  • 프로젝트 합류 알림은 해당 프로젝트 참여자에게 전달됩니다.
  • 일정 생성 시 새 일정 등록 알림과 일정 담당자 지정 알림은 정책 확인 후 둘 다 생성될 수 있도록 유지했습니다.
  • 알림 클릭 이동은 기존처럼 targetType, targetId, projectId를 기준으로 프론트에서 처리합니다.
  • 각 도메인은 NotificationRepositoryNotification 엔티티를 직접 사용하지 않고 NotificationService만 호출합니다.

✅ PR 체크리스트

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 변경 사항에 대한 테스트를 진행했습니다.

테스트

  • ./gradlew test

Summary by CodeRabbit

  • 새 기능

    • 파일 업로드 완료 시 프로젝트 멤버에게 알림을 보냅니다.
    • 프로젝트 초대 수락, 공지 등록, 일정 생성 시 활성 멤버에게 알림을 보냅니다.
  • 개선

    • 일정 배정, 프로젝트 합류, 일정 등록, 영상 피드백, 지원자 및 파일 등록 알림 문구를 자연스럽게 수정했습니다.
    • 공지 알림 문구에 마침표를 추가했습니다.

@guingguing guingguing linked an issue Aug 6, 2026 that may be closed by this pull request
7 tasks
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3239edbd-815a-4549-a058-39ac5aaa6b44

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

프로젝트 파일 업로드, 초대 수락, 공지 생성, 일정 생성 시 활성 프로젝트 멤버에게 개인 알림을 생성하도록 연결했습니다. 관련 알림 문구의 종결 표현도 수정했습니다. 공지 활동 흐름 통합 테스트에는 NotificationService 모의 빈을 추가했습니다.

Changes

도메인 알림 통합

Layer / File(s) Summary
알림 문구 수정
src/main/java/com/slatto/domain/notification/service/NotificationService.java
일정, 프로젝트 합류, 일정 등록, 영상 피드백, 지원자, 공지, 파일 알림 문구의 종결 표현을 수정했습니다. 공지 알림에는 마침표를 추가했습니다.
프로젝트 이벤트 알림 연결
src/main/java/com/slatto/domain/project/service/ProjectFileService.java, src/main/java/com/slatto/domain/project/service/ProjectInvitationService.java, src/main/java/com/slatto/domain/project/service/ProjectNoticeService.java, src/test/java/com/slatto/domain/notification/service/ProjectNoticeActivityFlowIntegrationTest.java
파일 업로드, 초대 수락, 공지 생성 후 활성 프로젝트 멤버의 사용자 ID를 조회하여 NotificationService를 호출합니다. 통합 테스트 컨텍스트에 NotificationService 모의 빈을 추가했습니다.
일정 생성 알림 연결
src/main/java/com/slatto/domain/schedule/service/ScheduleService.java
일정 생성 후 활성 프로젝트 멤버의 사용자 ID를 조회하고 일정 생성 알림을 생성합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectNoticeService
  participant ProjectMemberRepository
  participant NotificationService
  ProjectNoticeService->>ProjectMemberRepository: 활성 프로젝트 멤버 조회
  ProjectMemberRepository-->>ProjectNoticeService: 사용자 ID 목록 반환
  ProjectNoticeService->>NotificationService: 공지 생성 알림 요청
Loading

Possibly related PRs

  • SLAT-TO/SLATE-TO-BE#78: ScheduleServiceNotificationService의 일정 알림 동작을 함께 변경합니다.
  • SLAT-TO/SLATE-TO-BE#87: 이번 변경에서 사용하는 NotificationService 알림 생성 흐름과 직접 연결됩니다.
  • SLAT-TO/SLATE-TO-BE#120: 프로젝트 파일, 초대, 공지, 일정 서비스에서 사용하는 알림 메서드와 타입을 추가한 변경입니다.

Suggested reviewers: chazy-d, sangwon02

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 프로젝트 합류, 일정, 공지, 파일 등록 등 개인 알림 이벤트 연결이라는 주요 변경을 명확하게 요약합니다.
Description check ✅ Passed 관련 이슈, 작업 내용, 주요 변경 사항, 체크리스트, 테스트 결과를 포함해 템플릿 요구 사항을 충족합니다.
Linked Issues check ✅ Passed [127]의 프로젝트 합류, 일정, 공지, 파일 알림 연결과 수신자 조회 요구 사항을 변경 사항이 충족합니다.
Out of Scope Changes check ✅ Passed 알림 문구 수정, 수신자 조회, 테스트 보강은 연결된 이슈의 알림 도메인 연결 범위에 포함됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands.

@guingguing
guingguing requested a review from chazy-d August 6, 2026 10:16
@guingguing guingguing self-assigned this Aug 6, 2026
@guingguing guingguing added the feature 새로운 기능 추가 label Aug 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/test/java/com/slatto/domain/notification/service/ProjectNoticeActivityFlowIntegrationTest.java (1)

60-61: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

공지 알림 연결과 저장을 검증하도록 테스트를 보강하세요.

Line 60의 @MockBean NotificationService는 실제 알림 생성과 notification 테이블 저장을 우회합니다. 현재 테스트는 createProjectNotice가 알림 메서드를 호출하지 않아도 통과합니다.

최소한 verify(notificationService).createNoticeCreatedNotifications(...)로 호출 인자와 수신자 목록을 검증하세요. 저장 여부까지 확인하려면 실제 NotificationService를 포함한 별도 @DataJpaTest를 추가하세요.

🤖 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/slatto/domain/notification/service/ProjectNoticeActivityFlowIntegrationTest.java`
around lines 60 - 61, ProjectNoticeActivityFlowIntegrationTest의 `@MockBean`
notificationService가 실제 알림 생성과 저장을 우회하므로, createProjectNotice 테스트에서
notificationService.createNoticeCreatedNotifications(...) 호출을 수신자 목록과 함께
verify하도록 검증을 추가하세요. 저장까지 검증해야 한다면 실제 NotificationService를 사용하는 별도 `@DataJpaTest를`
추가하세요.
🤖 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/project/service/ProjectFileService.java`:
- Around line 130-137: Update the file-upload notification flow around
createFileUploadedNotifications to use savedFile.getId() as the PROJECT_FILE
targetId, and ensure NotificationService preserves that file ID when setting the
target. Do not use projectId as the target for PROJECT_FILE; if the intended
target remains the project, change the target type to PROJECT instead.

---

Nitpick comments:
In
`@src/test/java/com/slatto/domain/notification/service/ProjectNoticeActivityFlowIntegrationTest.java`:
- Around line 60-61: ProjectNoticeActivityFlowIntegrationTest의 `@MockBean`
notificationService가 실제 알림 생성과 저장을 우회하므로, createProjectNotice 테스트에서
notificationService.createNoticeCreatedNotifications(...) 호출을 수신자 목록과 함께
verify하도록 검증을 추가하세요. 저장까지 검증해야 한다면 실제 NotificationService를 사용하는 별도 `@DataJpaTest를`
추가하세요.
🪄 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: 8d9acd60-508f-423c-9c26-4400781e0506

📥 Commits

Reviewing files that changed from the base of the PR and between 2f1afb5 and d2029f4.

📒 Files selected for processing (6)
  • src/main/java/com/slatto/domain/notification/service/NotificationService.java
  • src/main/java/com/slatto/domain/project/service/ProjectFileService.java
  • src/main/java/com/slatto/domain/project/service/ProjectInvitationService.java
  • src/main/java/com/slatto/domain/project/service/ProjectNoticeService.java
  • src/main/java/com/slatto/domain/schedule/service/ScheduleService.java
  • src/test/java/com/slatto/domain/notification/service/ProjectNoticeActivityFlowIntegrationTest.java

Comment on lines +130 to +137
notificationService.createFileUploadedNotifications(
projectId,
project.getTitle(),
savedFile.getFileName(),
currentMember.getUser().getNickname(),
getActiveProjectMemberUserIds(projectId),
currentUserId
);

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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 기대 결과: PROJECT_FILE 알림의 targetId가 파일 ID이며 모든 소비자가 같은 계약을 사용한다.
rg -n -C 6 \
  'createFileUploadedNotifications|NotificationTargetType\.PROJECT_FILE|targetType|targetId' \
  src/main/java src/test/java

Repository: SLAT-TO/SLATE-TO-BE

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Candidate files =="
fd -p 'NotificationService\.java|NotificationTargetType\.java|ProjectFileService\.java|ProjectFile\.java|NotificationListProcessor|Notification.*Consumer|ActivityLogService\.java' src/main/java || true

echo
echo "== NotificationTargetType =="
rg -n -C 4 'enum NotificationTargetType|PROJECT_FILE|PROJECT_FILE' src/main/java src/test/java || true

echo
echo "== NotificationService file sections =="
file="$(fd 'NotificationService\.java' src/main/java | head -n1)"
if [ -n "${file}" ]; then
  wc -l "$file"
  rg -n -C 8 'createFileUploadedNotifications|createScheduleAssigned|createProjectJoined|createScheduleCreated|createVideoFeedbackCommented|targetType|targetId' "$file"
fi

echo
echo "== Processor/UserConsumer references =="
rg -n -C 5 'PROJECT_FILE|fileUploaded|SCHEDULE_CREATED|PROJECT|targetType|targetId|Notification.*EventListener|StreamListener|KafkaListener|Consumer' src/main/java/src/test java 2>/dev/null | head -n 200 || true
rg -n -C 5 'PROJECT_FILE|fileUploaded|SCHEDULE_CREATED|PROJECT|targetType|targetId|Notification.*EventListener|StreamListener|KafkaListener|Consumer' src/main/java src/test/java | head -n 240 || true

Repository: SLAT-TO/SLATE-TO-BE

Length of output: 50058


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== ProjectFileService upload section =="
file="$(fd 'ProjectFileService\.java' src/main/java | head -n1)"
if [ -n "${file}" ]; then
  sed -n '1,150p' "$file" | cat -n
fi

echo
echo "== ActivityLogService file upload section =="
file="$(fd 'ActivityLogService\.java' src/main/java | head -n1)"
if [ -n "${file}" ]; then
  rg -n -C 10 'createFileUploadedLog|createFileUploaded' "$file" || true
fi

echo
echo "== Read-only scan: PROJECT_FILE usages =="
rg -n -C 3 'NotificationTargetType\.PROJECT_FILE|PROJECT_FILE|PROJECT_FILE|PROJECT_FILE|targetType.*PROJECT_FILE|targetType.*"PROJECT_FILE"|type.*FILE_UPLOADED|FILE_UPLOADED' src/main/java src/test/java || true

echo
echo "== Read-only scan: Notification click/route helpers =="
rg -n -C 4 'targetType|targetId|get.*Route|navigate|router|FileUploaded|fileUploaded|FILE_UPLOADED|PROJECT_FILE' src/main/java src/test/java || true

Repository: SLAT-TO/SLATE-TO-BE

Length of output: 50376


PROJECT_FILE 알림의 대상 ID를 파일 ID로 맞추세요.

createFileUploadedNotifications()targetTypePROJECT_FILE로 설정한 뒤 targetIdprojectId를 저장합니다. NotificationTargetType.PROJECT_FILE을 사용할 목적이라면 savedFile.getId()를 전달하고 NotificationServicetargetId도 해당 파일 id로 고정하세요. 프로젝트 ID가 실제 대상이면 PROJECT_FILE 대신 targetTypePROJECT로 변경하세요.

수정 예시
 notificationService.createFileUploadedNotifications(
     projectId,
+    savedFile.getId(),
     project.getTitle(),
 public void createFileUploadedNotifications(
     Long projectId,
+    Long fileId,
     String projectTitle,
...
-    .targetId(projectId)
+    .targetId(fileId)
🤖 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/project/service/ProjectFileService.java`
around lines 130 - 137, Update the file-upload notification flow around
createFileUploadedNotifications to use savedFile.getId() as the PROJECT_FILE
targetId, and ensure NotificationService preserves that file ID when setting the
target. Do not use projectId as the target for PROJECT_FILE; if the intended
target remains the project, change the target type to PROJECT instead.

@chazy-d chazy-d left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고하셨습니다~

saveProjectRoles(projectMember, roleNames);
projectInvitation.accept(accepter);
activityLogService.createProjectMemberJoinedLog(project.getId(), accepter.getId());
notificationService.createProjectJoinedNotifications(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

excludeUserId를 추가하지 않아 다른 서비스들과 다르게 알림 대상에 행위자를 포함한 것은 의도하신 것일까요!?

@guingguing
guingguing merged commit 2f3136d into develop Aug 6, 2026
2 checks passed
@guingguing
guingguing deleted the feature/127-notification-domain-connections branch August 11, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: 개인 알림 도메인 연결

2 participants