Skip to content

[feat/#69] 알림 기능 서버 연동 (조회/삭제/읽음) + 딥링크 이동 - #73

Merged
oilbeaneda merged 6 commits into
developfrom
feat/#69-notification_api
Sep 23, 2026
Merged

oilbeaneda merged 6 commits into
developfrom
feat/#69-notification_api

Conversation

@oilbeaneda

@oilbeaneda oilbeaneda commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Related issue

Closes #69

작업 내용

알림 기능 서버 연동(조회/삭제/읽음) + 딥링크 이동을 데이터 레이어부터 붙였습니다.

데이터 레이어 (DTO → Service → DataSource → Repository)

  • NotificationResponse(DTO): 서버 명세 1:1 (notificationId/matchId/teamIds/type/title/content/createdAt/isRead/deepLinkType)
  • Notification(도메인 모델) + NotificationType/NotificationDeepLinkType enum — 미정의 값은 UNKNOWN 처리
  • NotificationMapper: DTO → 도메인 (createdAt을 OffsetDateTime으로 파싱)
  • NotificationService: GET /notifications, DELETE /notifications/{id}, PATCH /notifications/{id}/read
  • NotificationRemoteDataSource(+Impl) / NotificationRepository(+Impl) + Hilt 모듈 3종

ViewModel 연동

  • 더미 제거 → NotificationRepository로 실목록 조회
  • 삭제: 서버 호출, 404(이미 삭제)는 성공과 동일하게 목록에서 제거 (isHttpNotFound 헬퍼 추가)
  • 읽음: 카드 클릭 시 로컬 isRead 선반영 후 서버 반영 (멱등)

딥링크 이동

카드 클릭 → 읽음 처리 → deepLinkType별 홈 펍 화면으로 이동 + 필터 적용

  • TODAY_PUBS/NEARBY_PUBS → 오늘 요일, TOMORROW_GAME → 내일 요일 (businessDay KST 기준 계산)
  • teamIds(경기 홈+원정) + businessDay를 홈 savedStateHandle로 전달 (펍 필터 결과 전달과 동일 메커니즘)
  • UNKNOWN은 이동하지 않음

참고 / 후속

  • NEARBY_PUBS의 "내 위치 중심" GPS 센터링은 미구현(현재 오늘요일+teamIds 필터만)
  • 딥링크 시 구단칩 라벨은 비어 보일 수 있음(알림 응답에 팀 이름 없음, 조회는 정상)
  • createdAt 표기 규칙은 기획 확정 전까지 "M월 d일"

- NotificationResponse: 알림 목록 조회 응답 DTO (서버 명세 1:1)
- Notification: 도메인 모델 + type/deepLinkType enum(미정의 값 UNKNOWN 처리)
- NotificationMapper: DTO→도메인 변환(createdAt OffsetDateTime 파싱)
- NotificationService: 알림 목록 조회(GET)·삭제(DELETE)·읽음(PATCH .../read)
- NotificationServiceModule: Retrofit Service Hilt 제공
- NotificationRemoteDataSource(+Impl): Service를 감싸 데이터 접근 추상화
- NotificationDataSourceModule: 구현체 바인딩
- NotificationRepository(+Impl): DataSource 결과를 도메인 모델로 변환해 ViewModel에 전달
- 조회는 DTO→Notification 매핑, 삭제·읽음은 성공 여부 체크
- NotificationRepositoryModule: 구현체 바인딩
- NotificationViewModel: 더미 제거, NotificationRepository로 목록 조회
- 카드 클릭 시 읽음 처리(멱등, 로컬 선반영 후 서버 반영)
- 삭제 시 서버 호출, 404(이미 삭제)는 성공과 동일 처리
- Contract: OnItemClick 이벤트 + NotificationItem에 딥링크 필드(matchId/teamIds/deepLinkType) 추가
- 카드 onClick 연결, isHttpNotFound 헬퍼 추가
- OnItemClick: 읽음 처리 후 deepLinkType에 맞춰 홈 펍 화면으로 이동
- TODAY_PUBS·NEARBY_PUBS=오늘 요일, TOMORROW_GAME=내일 요일 businessDay 계산(KST)
- teamIds(홈+원정)+businessDay를 홈 savedStateHandle로 전달해 펍 필터 적용
- UNKNOWN deepLinkType은 이동하지 않음
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: swyp-5th-team9/android/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b944709e-cee6-4872-bc82-ef56639228e8

📥 Commits

Reviewing files that changed from the base of the PR and between 624f900 and 5840bac.

📒 Files selected for processing (18)
  • app/src/main/java/org/app/core/network/HttpErrorExt.kt
  • app/src/main/java/org/app/data/di/notification/NotificationDataSourceModule.kt
  • app/src/main/java/org/app/data/di/notification/NotificationRepositoryModule.kt
  • app/src/main/java/org/app/data/di/notification/NotificationServiceModule.kt
  • app/src/main/java/org/app/data/mapper/NotificationMapper.kt
  • app/src/main/java/org/app/data/model/Notification.kt
  • app/src/main/java/org/app/data/remote/datasource/api/NotificationRemoteDataSource.kt
  • app/src/main/java/org/app/data/remote/datasource/impl/NotificationRemoteDataSourceImpl.kt
  • app/src/main/java/org/app/data/remote/dto/NotificationResponse.kt
  • app/src/main/java/org/app/data/remote/service/NotificationService.kt
  • app/src/main/java/org/app/data/repository/api/NotificationRepository.kt
  • app/src/main/java/org/app/data/repository/impl/NotificationRepositoryImpl.kt
  • app/src/main/java/org/app/presentation/main/MainScreen.kt
  • app/src/main/java/org/app/presentation/notification/NotificationContract.kt
  • app/src/main/java/org/app/presentation/notification/NotificationScreen.kt
  • app/src/main/java/org/app/presentation/notification/NotificationViewModel.kt
  • app/src/main/java/org/app/presentation/notification/component/NotificationItemCard.kt
  • app/src/main/java/org/app/presentation/notification/navigation/NotificationNavigation.kt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

알림 조회, 읽음 처리, 삭제를 위한 API와 데이터 계층을 추가했습니다. ViewModel은 서버 알림을 상태로 관리합니다. 알림 클릭은 읽음 처리와 딥링크 이동으로 연결되며, 펍 필터 정보를 홈 화면에 전달합니다.

Changes

알림 API 연동

Layer / File(s) Summary
알림 데이터 계약과 저장소 흐름
app/src/main/java/org/app/data/model/Notification.kt, app/src/main/java/org/app/data/remote/..., app/src/main/java/org/app/data/repository/..., app/src/main/java/org/app/data/mapper/NotificationMapper.kt
알림 DTO와 도메인 모델을 추가했습니다. 조회, 삭제, 읽음 처리 API를 정의하고 데이터 소스와 저장소에서 호출합니다. 응답을 도메인 모델로 변환합니다.
Hilt 의존성 연결
app/src/main/java/org/app/data/di/notification/*
Retrofit 서비스, 원격 데이터 소스, 저장소 구현체를 SingletonComponent에 연결했습니다.
알림 상태와 동작 처리
app/src/main/java/org/app/core/network/HttpErrorExt.kt, app/src/main/java/org/app/presentation/notification/NotificationViewModel.kt
ViewModel이 서버 알림을 조회하고 상태에 저장합니다. 클릭 시 읽음 처리와 딥링크 이동을 수행합니다. 삭제 성공 또는 404 응답 시 목록에서 제거하고, 그 외 실패 시 토스트를 표시합니다.
알림 클릭과 펍 이동 연결
app/src/main/java/org/app/presentation/notification/NotificationContract.kt, app/src/main/java/org/app/presentation/notification/NotificationScreen.kt, app/src/main/java/org/app/presentation/notification/component/NotificationItemCard.kt, app/src/main/java/org/app/presentation/notification/navigation/NotificationNavigation.kt, app/src/main/java/org/app/presentation/main/MainScreen.kt
알림 카드 전체를 클릭할 수 있게 했습니다. 딥링크 사이드 이펙트를 화면 콜백으로 전달하고, 홈 화면에 팀 ID와 영업일을 저장합니다.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant NotificationScreen
  participant NotificationViewModel
  participant NotificationRepository
  participant NotificationService
  participant MainScreen
  NotificationScreen->>NotificationViewModel: 알림 카드 클릭
  NotificationViewModel->>NotificationRepository: 읽음 처리 및 딥링크 계산
  NotificationRepository->>NotificationService: PATCH /api/v1/notifications/{notificationId}/read
  NotificationViewModel-->>NotificationScreen: NavigateToPubs(teamIds, businessDay)
  NotificationScreen->>MainScreen: 펍 이동 콜백 전달
  MainScreen->>MainScreen: Home savedStateHandle에 필터 저장
Loading

Merge Risk: ⚪ Minimal · up to 5840b

The notification API and navigation integration appears mergeable with normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 이슈 #69는 알림 조회, 삭제, 읽음 처리 API 연동만 요구합니다. 그러나 PR은 추가로 OnItemClick, NavigateToPubs, NotificationDeepLinkType 기반 이동, KST 영업일 계산, savedStateHandle을 통한 홈 펍 필터 전달을 구현합니다. MainScreen.kt, `Notificati… 딥링크 및 홈 펍 필터 이동 변경을 별도 이슈와 PR로 분리하십시오. 이 PR에 유지하려면 해당 기능을 요구하는 연결 이슈를 추가하고 범위를 명시하십시오.
Docstring Coverage ⚠️ Warning Docstring coverage is 19.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 41 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 이슈 #69의 세 가지 코딩 요구사항을 구현했습니다. NotificationService가 조회(GET /api/v1/notifications), 삭제(DELETE /api/v1/notifications/{notificationId}), 읽음 처리(PATCH /api/v1/notifications/{notificationId}/read) AP…
Title check ✅ Passed 제목이 알림 서버 연동과 딥링크 이동이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Description check ✅ Passed 관련 이슈와 작업 내용을 구체적으로 작성했으며 데이터 계층, ViewModel 연동, 딥링크 동작과 미구현 사항을 설명합니다. 템플릿의 Screenshot 및 Uncompleted Tasks 섹션은 없지만 핵심 정보는 충분합니다.
Full details: Out of Scope Changes check

Explanation

이슈 #69는 알림 조회, 삭제, 읽음 처리 API 연동만 요구합니다. 그러나 PR은 추가로 OnItemClick, NavigateToPubs, NotificationDeepLinkType 기반 이동, KST 영업일 계산, savedStateHandle을 통한 홈 펍 필터 전달을 구현합니다. MainScreen.kt, NotificationContract.kt, NotificationViewModel.kt의 이 변경은 세 API 요구사항의 구현 또는 검증과 직접 연결되지 않습니다.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@oilbeaneda oilbeaneda self-assigned this Sep 23, 2026
@oilbeaneda oilbeaneda added Feat ✨ 신규 기능을 추가하거나 기존 기능의 동작, 정책을 변경 🔗 API API 연동 labels Sep 23, 2026
@oilbeaneda
oilbeaneda merged commit 4ba2bf2 into develop Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔗 API API 연동 Feat ✨ 신규 기능을 추가하거나 기존 기능의 동작, 정책을 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 알림 API 연동

1 participant