Open
Conversation
Contributor
상세 내용기존 코드에는 해당 기능이 구현되어 있지 않았으며, 멤버의 탈퇴와 팀에서의 제거는 동일한 요구사항을 가졌습니다. 이에 대한 결정을 하기 위해 회의를 진행한 결과, 팀 서비스단에서 구현하는 것과 포트를 통해 구현하는 방법 중 포트를 통해 어댑터에서 처리하는 것으로 결정하여 구현하였습니다. 포트를 선택한 이유는 서비스단에서 구현하게 되면 멤버가 팀 서비스에 의존성을 가지게 되어 의존성이 높아지고, 이렇게 되면 추후 유지보수와 확장성 측면에서 제한될 수 있다고 판단하여 후자가 채택되었습니다! 문제 발견
|
nahyeon99
commented
May 12, 2024
Comment on lines
+33
to
+46
| final Team team = loadTeamPort.findByMemberId(member.getId()); | ||
| final List<TeamCalendar> teamCalendars = loadTeamCalendarPort.findByMemberId(member.getId()); | ||
|
|
||
| team.deleteMember(member); | ||
| if (team.getMembers().isEmpty()) { | ||
| deleteTeamPort.delete(team); | ||
| } else { | ||
| deleteSleepoverCalendarPort.deleteByMemberId(memberId); | ||
| deleteSleepoverCalendarPort.deleteByMemberId(member.getId()); | ||
| teamCalendars | ||
| .forEach(teamCalendar -> teamCalendar.deletePariticipant(member.getId())); | ||
| .forEach(teamCalendar -> { | ||
| teamCalendar.deletePariticipant(member.getId()); | ||
| if (teamCalendar.getParticipants().isEmpty()) | ||
| deleteTeamCalendarPort.delete(teamCalendar); | ||
| }); |
Member
Author
There was a problem hiding this comment.
팀에 회원이 한 명 남았을 때 teamStatus가 변경되어야 합니다.
Contributor
There was a problem hiding this comment.
팀 도메인의 deleteMember() 내에 처리되어 있습니다!
nahyeon99
commented
May 12, 2024
Comment on lines
34
to
47
| @Override | ||
| public void deleteTeamMember(Long memberId) { | ||
| final Member member = loadMemberPort.loadMember(memberId); | ||
| public void deleteTeamMember(Member member) { | ||
| final Team team = loadTeamPort.findByMemberId(member.getId()); | ||
| final List<TeamCalendar> teamCalendars = loadTeamCalendarPort.findByMemberId(member.getId()); | ||
|
|
||
| team.deleteMember(member); | ||
| if (team.getMembers().isEmpty()) { | ||
| deleteTeamPort.delete(team); | ||
| } else { | ||
| deleteSleepoverCalendarPort.deleteByMemberId(memberId); | ||
| deleteSleepoverCalendarPort.deleteByMemberId(member.getId()); | ||
| teamCalendars | ||
| .forEach(teamCalendar -> teamCalendar.deletePariticipant(member.getId())); | ||
| .forEach(teamCalendar -> { | ||
| teamCalendar.deletePariticipant(member.getId()); | ||
| if (teamCalendar.getParticipants().isEmpty()) | ||
| deleteTeamCalendarPort.delete(teamCalendar); | ||
| }); | ||
| } |
Member
Author
Contributor
There was a problem hiding this comment.
해당 부분은 제 쪽에서는 예외가 터지지 않아 문제 원인을 제대로 파악하지 못 하고 있습니다..
그러나 해당 부분의 예외는 teamCalendar의 participant에 memberId가 없을 경우에 예외가 발생할 수 있는데, 팀캘린더를 participant와 조인하여 조회하기 때문에 예외가 발생할 가능성이 거의 없다고 생각됩니다..
그렇지만 예외가 발생한 원인을 명확하게 파악하기위해 계속해서 분석하겠습니다! 혹시 원인 파악에 도움이 될만한 정보가 있다면 공유 해주시면 감사하겠습니다!
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.

❗️ 이슈 번호
open #72
📝 구현 내용
일부 로직을 제외하고, 회원 탈퇴 로직을 구현했습니다. 일부 기능은 송현 님 파트와 직결된 부분이라 제 임의로 구현하기에 애매해서 논의 후 이어서 진행할 예정입니다.
🙇🏻♂️ 리뷰어에게 부탁합니다!
회원 탈퇴 용도가 아닌, 기존의 TeamCalendar를 삭제하는 기능도 Participant가 예상한 쿼리로 나가서 정상적으로 삭제가 됐나요? 코드상으로 애매해 보여서 확인이 필요할 것 같습니다..!
회원 탈퇴 시 Team, TeamCalendar, Participant에 대해 고려해야 하는 시나리오는 다음과 같습니다. 이에 대해 쿼리를 어떻게 나눠서 보내서 삭제 할 지 정해야 합니다.
Team 내 Member 제거 시나리오
💡 참고 자료