Skip to content

feat: harden notifications and related flows#170

Merged
lejuho merged 1 commit into
developfrom
feat/notification-hardening
Feb 3, 2026
Merged

feat: harden notifications and related flows#170
lejuho merged 1 commit into
developfrom
feat/notification-hardening

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Feb 3, 2026

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 알림 시스템에 디버그 이벤트 로깅 기능 추가
    • 마케팅 알림 동의 여부 관리 기능 추가
    • 알림 읽음 상태 조회 시 사용자 권한 검증 추가
  • Improvements

    • 서울 시간대 기반 시간 계산 개선
  • Documentation

    • 알림 서비스 디버그 이벤트 문서 추가
  • Tests

    • 알림 서비스 테스트 스위트 재작성

@lejuho lejuho merged commit b006d4f into develop Feb 3, 2026
0 of 2 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

🚨 PR 본문이 비어있습니다!

아래 템플릿을 복사하여 PR 내용을 작성해주세요.


📝 개요

이번 PR의 핵심 내용을 한 줄로 요약해 주세요.


💻 작업 내용

이번 PR에서 작업한 내용을 상세히 설명해 주세요.

  • 작업 내용 1
  • 작업 내용 2
  • ...

✅ PR 체크리스트

PR을 보내기 전에 아래 체크리스트를 확인해 주세요.

  • 커밋 메시지는 포맷에 맞게 작성했나요?
  • 스스로 코드를 다시 한번 검토했나요?
  • 관련 이슈를 연결했나요?
  • 빌드 및 테스트가 로컬에서 성공했나요?

🔗 관련 이슈

이번 PR과 관련된 이슈 번호를 기재해 주세요.
예: Closes #123


스크린샷 (선택)

UI 변경 사항이 있다면 스크린샷을 첨부해 주세요.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 3, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

알림 서비스에 디버그 이벤트 로깅, 마케팅 동의 검증, 인증된 사용자 기반 권한 검사 기능을 추가했습니다. 또한 한국 시간대(Asia/Seoul) 적용, NotificationType에 마케팅 플래그 추가, 테스트 재작성이 포함되었습니다.

Changes

Cohort / File(s) Summary
알림 서비스 핵심 변경
src/main/java/.../member/notification/service/NotificationService.java, src/main/java/.../member/notification/presentation/NotificationController.java
디버그 로깅 추가(샘플링 기반), 알림 비활성화/마케팅 동의 검증, readNotification에 userId 매개변수 추가 및 권한 검사 구현.
알림 타입 및 설정
src/main/java/.../member/notification/domain/NotificationType.java, src/main/resources/application.yml
NotificationType 열거형에 marketing 불린 플래그 추가(모두 false), application.yml에 notification.debug 설정 블록 추가.
시간대 표준화
src/main/java/.../home/service/HomeService.java, src/main/java/.../tracking/service/TrackingService.java
Asia/Seoul 시간대 상수 도입, LocalDate.now()/LocalDateTime.now() 호출을 KOREA_ZONE으로 일관성 있게 변경.
도메인 로직 변경
src/main/java/.../delivery/service/DeliveryService.java, src/main/java/.../garden/garden/service/GardenService.java
DeliveryService 알림 발신자를 null로 변경, GardenService에서 garden 객체의 User 사용 및 친구 물주기 시간 기록 메서드 호출 추가.
문서 및 테스트
docs/notifications-debug-events.md, src/test/java/.../notification/service/NotificationServiceTest.java
알림 디버그 이벤트 문서화, NotificationService 테스트 전체 재작성(알림 비활성화, 읽기 권한 검증 시나리오 추가).

Sequence Diagram(s)

sequenceDiagram
    actor User as 인증된 사용자
    participant Controller as NotificationController
    participant Service as NotificationService
    participant Repo as NotificationRepository
    participant Domain as Notification 객체

    User->>Controller: readNotification(notificationId)
    Controller->>Service: readNotification(userId, notificationId)
    Service->>Repo: 알림 ID로 알림 조회
    Repo-->>Service: Notification 반환
    Service->>Domain: 알림 수신자 ID 확인
    alt userId == 알림 수신자 ID
        Service->>Domain: 읽음 상태로 표시
        Service->>Repo: 알림 저장
        Repo-->>Service: 저장 완료
        Service-->>Controller: 성공
        Controller-->>User: ApiResponse.success(null)
    else userId != 알림 수신자 ID
        Service-->>Controller: IllegalArgumentException 발생
        Controller-->>User: 오류 응답
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

Refactor

Suggested reviewers

  • xoruddl
  • c5ln

Poem

🐰 알림의 문지기가 생겼네요!
사용자만 자신의 알림을 읽고,
마케팅은 동의 후에만 도착하고,
한국 시간이 정확하게 흐르네요.
이제 안전하고 명확한 알림 세상! 🌙✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/notification-hardening

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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant