Skip to content

Commit

Permalink
[Refactor/#185] refactor by feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Jeong committed Apr 7, 2024
1 parent 68a41ff commit c291998
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public interface TeamCommandService {

void deleteTeam(Long teamId, Member member);

Long addTeamMemberByLeader(Long teamId, Long newMemberId, Member member);

void deleteTeamMemberByLeader(Long teamId, Long memberId, Member leader);

void deleteTeamMemberByMyself(Long teamId, Member member);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@ public void deleteTeam(Long teamId, Member member) {
teamRepository.delete(team);
}

@Override
//no usages인데 지워도 되나요
public Long addTeamMemberByLeader(Long teamId, Long newMemberId, Member leader) {
Team team = teamRepository.findById(teamId)
.orElseThrow(() -> new TeamHandler(ErrorStatus.TEAM_NOT_FOUND));
Member newMember = memberRepository.findById(newMemberId)
.orElseThrow(() -> new MemberHandler(ErrorStatus.MEMBER_NOT_FOUND));
Participation participation = buildParticipation(newMember, team);
participation.setStatus(ParticipationStatus.ACCEPTED);

validateCallerIsLeader(team, leader);
validateMemberDuplication(team, newMember);
validateLimitOfTeamCapacity(team);
addMemberToTeam(team, leader);
participationRepository.save(participation);

return team.getId();
}

@Override
public void deleteTeamMemberByLeader(Long teamId, Long memberId, Member leader) {
Team team = teamRepository.findById(teamId)
Expand Down

0 comments on commit c291998

Please sign in to comment.