[refactor/#698] 모임/알림 도메인 책임 분리 및 destination 기반 알림 V2 API 도입 - #699
Open
kanghana1 wants to merge 8 commits into
Open
[refactor/#698] 모임/알림 도메인 책임 분리 및 destination 기반 알림 V2 API 도입#699kanghana1 wants to merge 8 commits into
kanghana1 wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❤️ 기능 설명
모임 도메인이 알림 서비스(
NotificationCommandService)를 직접 호출하던 구조를 도메인 이벤트 기반으로 분리했습니다. 이 과정에서 알림 조회/리다이렉트를 알림 타입(type)이 아니라 destination(resourceType·resourceId·action) 기반으로 재설계한 V2 API를 도입했습니다.기존 V1 API는 스펙을 그대로 유지한 채
@Deprecated처리하고, V2로 생성된 알림에도 V1 호환 필드를 함께 저장하여 프론트의 V2 전환 기간 동안 무중단 호환을 보장합니다.주요 변경사항
PartyCommandService가NotificationCommandService를 직접 호출하던 구조를 제거하고 도메인 이벤트 발행으로 전환PartyInfoChangedEvent/PartyDeletedEvent/PartyJoinRequestApprovedEvent/PartyRoleChangedEventPartyInvitationCreatedEvent/PartyInvitationAcceptedEventPartyNotificationEventListener가@TransactionalEventListener(AFTER_COMMIT)+@Async로 소비 → 알림 생성이 모임 트랜잭션과 분리됨PartyInvitation)와 알림 상태의 생명주기 분리GET /api/v2/notifications— 커서 페이지네이션 조회 (destination 포함)PATCH /api/v2/notifications/{id}/read— 읽음 처리 (초대 수락·거절은 초대 API로 분리)Notification에resourceType·resourceId·action컬럼 및 조회 인덱스 추가PARTY_INVITATION+invitationId+RESPONDPARTY+partyId+VIEWnull@Deprecated(forRemoval)만 부착partyId,type,data)를 함께 저장(dual-write)하여 V1 API로도 정상 조회type매핑은 기존NotificationTarget의 defaultType과 1:1 동일 (INVITE→INVITE, 수정→CHANGE, 삭제·수락·역할→SIMPLE)기대효과
PartyInvitation)와 알림 상태의 생명주기 분리프론트에서 V2로 반영하면 추후 레거시코드는 삭제 예정입니다.
연결된 issue
연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #698 close #690
🩷 Approve 하기 전 확인해주세요!
✅ 체크리스트