Skip to content
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

Fix/#60 출석 관련 세부 로직 추가 #62

Merged
merged 8 commits into from
Jul 20, 2023
Merged

Fix/#60 출석 관련 세부 로직 추가 #62

merged 8 commits into from
Jul 20, 2023

Conversation

PgmJun
Copy link
Member

@PgmJun PgmJun commented Jul 19, 2023

✒️ 관련 이슈번호

🔑 Key Changes

  1. 내용
  • 출석체크 시 오늘의 아티클인지 확인하는 로직 추가
  • 출석 시 출석 횟수에 따라 레벨 업데이트 로직 추가

📢 To Reviewers

@PgmJun PgmJun added ⚡️ fix 간단한 수정 2️⃣ Size/L 중요도 L labels Jul 19, 2023
@PgmJun PgmJun requested a review from orijoon98 July 19, 2023 19:50
@PgmJun PgmJun self-assigned this Jul 19, 2023
Comment on lines 22 to 26
public static ChallengeLevelType findByLevel(int level) {
return Arrays.stream(values())
.filter(t -> t.level == level)
.findFirst()
.orElse(LEVEL_FIVE);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네이밍 get(int level) 어떤가요?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네이밍 get(int level) 어떤가요?!

get은 Getter메서드 느낌이 강해서 find 는 어떠신가요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋아용~

Comment on lines 30 to 45
public void checkAttendance(Article article, Member member) {
if (checkIsNotAttended(member)) {
if (checkIsTodayArticle(article, member)) {
attendanceRepository.save(Attendance.newInstance(member));

int attendanceCheckCount = attendanceRepository.findAttendancesByMember(member).size();
member.getChallenge().levelUp(attendanceCheckCount);
}
}
}

private boolean notAttended(Member member) {
Optional<Attendance> firstMemberAttendance = findMemberLastAttendance(member);
if (firstMemberAttendance.isEmpty()) {
private boolean checkIsTodayArticle(Article article, Member member) {
WeekAndDay weekAndDay = MemberServiceUtils.findMemberWeekAndDay(member);

return weekAndDay.equals(WeekAndDay.of(article.getWeek(), article.getDay()));
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean 메서드는 is 로 시작하는거 어떤가요?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean 메서드는 is 로 시작하는거 어떤가요?!

isPresent() 예시를 듣고 인정하였읍니다

Comment on lines 35 to 55
return DateUtils.getDayDifference(LocalDateTime.now(), firstMemberAttendance.get().getCreatedAt()) != 0;
boolean isNotAttended =
DateUtils.getDayDifference(LocalDateTime.now(), memberLatestAttendance.get().getCreatedAt()) != ZERO;

return isNotAttended;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 바로 return 하는거 의견 제시해봅니당..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 바로 return 하는거 의견 제시해봅니당..

넵! 뭔가 필요없이 코드라인이 낭비되는 느낌이 드네요..!

@PgmJun PgmJun merged commit f26d533 into develop Jul 20, 2023
@PgmJun PgmJun deleted the fix/#60 branch July 20, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2️⃣ Size/L 중요도 L ⚡️ fix 간단한 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

출석 관련 세부 로직 추가
2 participants