Conversation
Closed
📊 코드 커버리지 리포트
|
minibr
reviewed
Dec 18, 2025
src/main/java/com/sofa/linkiving/domain/chat/facade/ChatFacade.java
Outdated
Show resolved
Hide resolved
minibr
reviewed
Dec 18, 2025
77cc7a5 to
a23f63d
Compare
a23f63d to
9144995
Compare
minibr
approved these changes
Dec 19, 2025
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.
관련 이슈
PR 설명
작업 내용
1. API 구현 (
ChatController)DELETE /v1/chats/{chatId}{ "success": true, "status": "OK", "message": "성공적으로 삭제했습니다.", "data": null }2. 아키텍처 및 비즈니스 로직 (
Facade&Service)ChatFacade):@Transactional범위 내에서 피드백 삭제 -> 메시지 삭제 -> 채팅방 삭제 순서로 로직을 실행하여 데이터 무결성을 보장함.3. Repository 구현 (
@Query최적화 및 Bulk Operation)delete메서드 대신@Query를 사용하여 직접DELETE문을 실행함.FeedbackRepository:deleteAllByMessageInQuery:@Modifying(clearAutomatically = true)를 적용하여 Bulk Delete 수행 후 영속성 컨텍스트를 초기화함으로써 데이터 동기화를 보장함.MessageRepository:deleteAllByChat: 특정 채팅방에 속한 모든 메시지를 일괄 삭제하는 최적화 쿼리를 작성함.ChatRepository:delete: 최종적으로 채팅방 엔티티를 제거함.4. 테스트 작성 (Aggregate 관점 포함)
ChatIntegrationTest):Chat,Message,Feedback리포지토리에서 해당 ID의 데이터가 조회되지 않음을 검증함 (Hard Delete 확인).ACCESS_DENIED등) 여부를 테스트함.Chat을 Aggregate Root로 간주하여 테스트를 진행함.Chat삭제 시 하위 엔티티인Message와Feedback까지 의도한 대로 일괄 삭제되는지 Aggregate 전체의 데이터 정합성을 한번에 검증함.ChatFacadeTest):Feedback->Message->Chat)가 FK 제약 조건을 준수하는지 확인함.