-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add a member policy when start match #525
refactor: add a member policy when start match #525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다.
) { | ||
StartMatchCommand startMatchCommand = | ||
new StartMatchCommand(clubToken, leagueId, matchId); | ||
clubMemberPolicy.validateLeagueParticipant(leagueId, member.getMemberToken()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
검증을 추가했군요
좋은 생각입니다.
throw new LeagueParticipantsNotExistsException(matchId); | ||
throw new LeagueParticipantNotDeterminedException(matchId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이름을 바꾼 이유가 있나요!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
경기 참여자가 존재하지 않는다 -> 라는 게 조금 모호한 것 같아요. 해당 예외는 부전승 경기에서 아직 나머지 짝꿍이 정해지지 않았을 때 Match 를 시작하려고 하거나, 점수를 올리려고 할 때 나는 예외입니다. 따라서 상대 경기 참여자가 아직 결정되지 않았다는 의미를 더해 바꾸게 되었습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다
public LeagueParticipantsNotExistsException(Long matchId) { | ||
super(ErrorCode.LEAGUE_PARTICIPANTS_NOT_EXISTS, "[매치 ID : " + matchId + "]"); | ||
super(ErrorCode.LEAGUE_NOT_PARTICIPATED, "[매치 ID : " + matchId + "]"); | ||
} | ||
|
||
public LeagueParticipantsNotExistsException(Long matchId, Exception e) { | ||
super(ErrorCode.LEAGUE_PARTICIPANTS_NOT_EXISTS, "[매치 ID : " + matchId + "]", e); | ||
super(ErrorCode.LEAGUE_NOT_PARTICIPATED, "[매치 ID : " + matchId + "]", e); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 커스텀 예외의 네임만 보고 내가 이 경기에 참가하지 않아서 나는 예외인지, 이 경기에 아직 참가자가 존재하지 않아서 나는 예외인지 모호한 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LeagueNotParticipatedException으로 바꿔야겠네요!
PR에 대한 설명 🔍
start match를 하려면 경기 참여를 한 사용자여야 합니다.
변경된 사항 📝
PR에서 중점적으로 확인되어야 하는 사항