Skip to content

feat: 인앱 알림(notification_log) 도메인 구현#23

Open
2nayeon wants to merge 1 commit into
developfrom
feature/notification-log
Open

feat: 인앱 알림(notification_log) 도메인 구현#23
2nayeon wants to merge 1 commit into
developfrom
feature/notification-log

Conversation

@2nayeon

@2nayeon 2nayeon commented Jul 16, 2026

Copy link
Copy Markdown

변경 사항

1. notification_log 도메인 신규 구현

  • NotificationLog 엔티티/Repository/Service/Controller
  • GET /api/notification: 알림 목록 조회 (최신순)
  • PATCH /api/notification/{notificationId}/read: 읽음 처리 (본인 알림만 가능하도록 체크)
  • NotificationLogService.saveLog(): 다른 도메인에서 알림 기록을 남길 때 사용하는 공용 메소드

2. 복약 완료/미응답 알림 연동

  • PillLogService.confirmPill(): WARD가 복약 확인 시 보호자에게 실시간 알림 발송 + notification_log 저장
  • PillNotificationScheduler.notifyProtector(): 3회 미응답 시 notification_log 저장 추가

3. 재알림 스케줄러 버그 수정

  • 재시도 횟수가 FCM 발송 성공 시에만 증가하던 문제 → finally 블록으로 이동해 발송 성공 여부와 무관하게 카운트되도록 수정
  • @Transactional 누락으로 재시도 횟수/보호자 알림 처리가 실제 DB에 반영되지 않던 문제 수정 (재알림 로직이 3회 이후 보호자 알림까지 도달 못 하던 심각한 버그)

배경

"보호자 알림" 화면(복약 완료/미이행 알림 목록) 구현을 위한 백엔드 작업. 화면 시안 확인 중 재알림 로직 테스트하다가 트랜잭션 관련 버그를 추가로 발견하여 함께 수정함.

테스트

  • 복약 완료 시 notification_log 기록 및 실시간 알림 확인
  • 재알림 3회 초과 시 current_retry_count 정상 증가 및 notification_log 기록 확인
  • GET/PATCH 알림 API 정상 동작 확인
  • 본인 알림이 아닌 것에 읽음 처리 시도 시 차단 확인

참고

  • "하루 요약 레포트 도착" 알림은 report 도메인 미구현으로 이번 범위에서 제외 (추후 별도 작업 예정)

@2nayeon
2nayeon requested a review from leeseny09 July 16, 2026 04:34
@2nayeon 2nayeon self-assigned this Jul 16, 2026
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