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

[OING-173] feat: MVP 2차 추억 캘린더 배너 구현 #132

Merged
merged 12 commits into from
Jan 31, 2024

Conversation

Kwon770
Copy link
Collaborator

@Kwon770 Kwon770 commented Jan 31, 2024

❓ 기능 추가 배경


�MVP 2차 기획으로 변경된 추억 캘린더의 배너 전체 기능을 구현하였습니다. 최적화는 전혀 적용되지 않고 구현에만 집중한 버전이므로, 차후 작업이 필요합니다.

➕ 추가/변경된 기능


  • 가족의 상위 백분율을 계산하기 위해 family 테이블에 score 필드 추가
  • 유저의 모든 활동 (게시글, 댓글, 리액션, 리얼 이모지)에 EntityListener를 추가하고, 새로글 활동이 생성 및 삭제 될 때 family score 감가산 기능 구현
  • 가족의 상위 백분율 계산 기능 구현
  • 특정 달 동안 모든 가족이 게시글을 올린 날을 계산하는 기능 구현 (각 가족 구성원이 가족에 참가한 날짜를 고려하여 유동적으로 계산)
  • 가족 활성화 레벨을 계산하기 위한 각종 필드 계산 기능 구현

1단계: 기본
2단계: 모두 업로드 한 날이 1일 이상 OR 업로드된 사진 2개 이상
3단계: 이때까지 모두 업로드가 연속되면 OR (업로드 사진 10개이상 and 리액션 10개 이상)
4단계: 모두 업로드 20일 이상 or (업로드 사진 60개 이상 and 리액션 120개 이상)

  • 필드에 맞게 가족 활성화 레벨링을 나누고, 알맞은 베너 이미지를 결정하여 반환

🥺 리뷰어에게 하고싶은 말


🚨 전반적인 비즈니스 로직을 추가 및 변경하는 기능이 였으나 시간이 모자라여 테스트 코드 작성과 디버깅이 미흡하였습니다. 세밀하게 리뷰해주시면 감사하겠습니다 😭 🚨

🔗 참조 or 관련된 이슈


https://no5ing.atlassian.net/browse/OING-173

@github-actions github-actions bot changed the title feat: MVP 2차 추억 캘린더 배너 구현 [OING-173] feat: MVP 2차 추억 캘린더 배너 구현 Jan 31, 2024
Copy link

github-actions bot commented Jan 31, 2024

Test Results

39 files  39 suites   8s ⏱️
91 tests 90 ✅ 0 💤 1 ❌
92 runs  91 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 7184073.

♻️ This comment has been updated with latest results.

@Kwon770 Kwon770 self-assigned this Jan 31, 2024
@Kwon770 Kwon770 added the ✨ FEATURE 기능 추가 label Jan 31, 2024
Copy link
Member

@Ji-soo708 Ji-soo708 left a comment

Choose a reason for hiding this comment

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

코멘트 확인해주세요!

@@ -101,10 +108,14 @@ public Page<FamilyMemberProfileResponse> findFamilyMembersProfilesByFamilyId(
return new PageImpl<>(familyMemberProfiles, memberPage.getPageable(), memberPage.getTotalElements());
}

public long countFamilyMembersByFamilyIdBefore(String familyId, LocalDate date) {
return memberRepository.countByFamilyIdAndFamilyJoinAtBefore(familyId, date.atStartOfDay());
Copy link
Member

Choose a reason for hiding this comment

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

혹시 1월 1일에 가족 전체 멤버가 2명인 가족이 모두 포스트를 올렸는데 1월 2일에 새 멤버가 추가되어서 전체 멤버가 3명이 되면 1월 1일에 올린 포스트는 가족 모두가 올린 날에 집계가 되나요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아닙니다. 글이 업로드 된 그 당시의 날에 존재했던 멤버가 전부 올렸는지가 기준입니다. 1월1일에는 2개의 사진이 올라와야만 하고, 1월2일에는 3개의 사진이 올라와야 전부 올라온 날인 것 입니다.

@Ji-soo708 Ji-soo708 self-requested a review January 31, 2024 09:06
Copy link
Member

@Ji-soo708 Ji-soo708 left a comment

Choose a reason for hiding this comment

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

코멘트 확인해주세요~

Copy link

sonarcloud bot commented Jan 31, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@CChuYong CChuYong merged commit 700c63e into dev Jan 31, 2024
2 of 4 checks passed
@CChuYong CChuYong deleted the feature/OING-173 branch January 31, 2024 11:30
CChuYong pushed a commit that referenced this pull request Jan 31, 2024
* feat: Add familyScore definition

* feat: Add JpaEntity and SpringEvent to add score per user activity

* feat: Add the events to substract score per canceled user activity

* fix: Change FamilyScoreEventListener annotation to fix not committed score event

* feat: Impl the code to calculate the familyTopPercentage in getBanner API

* feat: Impl the code to count family activity in getBanner API

* feat: Add counting code to banners dynamic fields(allFamilyMembersUploadedDays, allFamilyMembersUploadedStreaks) and Impl getBanner API with a lot of comments

* fix: Fix broken test code with changed Member entity

* fix: Handle divide by zero error from calculateFamilyTopPercentile method

* fix: Replace inclusiveToday as endDate from the code to calculate dynamic field of getBanner API to fix wrongly selected period

* chore: Clear the commenting at redis cache annotation in MemberPostController
CChuYong pushed a commit that referenced this pull request Jan 31, 2024
* feat: Add familyScore definition

* feat: Add JpaEntity and SpringEvent to add score per user activity

* feat: Add the events to substract score per canceled user activity

* fix: Change FamilyScoreEventListener annotation to fix not committed score event

* feat: Impl the code to calculate the familyTopPercentage in getBanner API

* feat: Impl the code to count family activity in getBanner API

* feat: Add counting code to banners dynamic fields(allFamilyMembersUploadedDays, allFamilyMembersUploadedStreaks) and Impl getBanner API with a lot of comments

* fix: Fix broken test code with changed Member entity

* fix: Handle divide by zero error from calculateFamilyTopPercentile method

* fix: Replace inclusiveToday as endDate from the code to calculate dynamic field of getBanner API to fix wrongly selected period

* chore: Clear the commenting at redis cache annotation in MemberPostController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ FEATURE 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants