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-330] feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 #250

Merged
merged 7 commits into from
May 9, 2024

Conversation

Kwon770
Copy link
Collaborator

@Kwon770 Kwon770 commented May 7, 2024

❓ 기능 추가 배경


가족 구성원 랭킹에서 '지난 날 생존신고 보기' 버튼이 금월에 해당하며 금월에 업로드된 생존신고가 없다면 비활성화(null)된다는 정책이 확정되어, 이를 반영하는 PR입니다.

➕ 추가/변경된 기능


  • 정해진 기간동안 가장 최근 생존신고를 조회하는 findRecentPost API 추가
  • findRecentPost를 이용해 가족 구성원 랭킹 수정
  • findRecentPost 쿼리에 대한 테스트 코드 추가

🥺 리뷰어에게 하고싶은 말


🔗 참조 or 관련된 이슈


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

@Kwon770 Kwon770 added ✨ FEATURE 기능 추가 ✅ TEST 테스트 코드 추가 우선순위_3 labels May 7, 2024
@Kwon770 Kwon770 requested review from CChuYong and Ji-soo708 May 7, 2024 14:59
@Kwon770 Kwon770 self-assigned this May 7, 2024
@github-actions github-actions bot changed the title feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 [OING-330] feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Test Results

 50 files   50 suites   11s ⏱️
139 tests 139 ✅ 0 💤 0 ❌
140 runs  140 ✅ 0 💤 0 ❌

Results for commit ebfaba1.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 7, 2024

Code Coverage

File Coverage [60.28%]
PostRepositoryCustomImpl.java 80.23% 🍏
PostController.java 76.49%
PostService.java 70.59%
MainViewController.java 22.64%
Total Project Coverage 51.86% 🍏

Copy link

sonarcloud bot commented May 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@Kwon770 Kwon770 merged commit 8af2a75 into dev May 9, 2024
4 checks passed
@Kwon770 Kwon770 deleted the feature/OING-330 branch May 9, 2024 14:43
Ji-soo708 pushed a commit that referenced this pull request May 9, 2024
* feat: Add getLatestPost API to implement new policy of family member ranking

* fix: Add null handling in getLatestPostAPI

* feat: Make mostRecentSurvivalPostDate return most recent surcicial post date in this month else then return null

* refactor: Refactor nested test class in MianviewApiTest to follow naming convention

* feat: Add test code for findLatestPost in PostRepositoryCustomImpl

* refactor: Add PostType paramter at getRecentPost API

* feat: Add createdAt index at post table
Kwon770 added a commit that referenced this pull request May 9, 2024
* chore: update ECS Service name

* chore: update production ecs

* refactor: Translate english error message to Korean (#224)

* [OING-300] feat: 콕 찌르기 API 구현 (#222)

* feat: implementing pick..

* feat: implement pick feature

* feat: add picked members api

* feat: implement picked api

* feat: implement GET api

* feat: check member exists

* feat: update api specs

* feat: concat sql queries

* feat: seperate notification

* [OING-289] refactor: Member 모듈의 안티패턴과 짜잘한 부분 리팩토링 (#223)

* refactor: Remove unused api parameter got by parsing token and reformat parameter sequence from MemberController. MemberApi

* refactor: Rename and reformat the methods in MemberController

* refactor: Rename and reformat the methods in MemberSerivce

* refactor: Fix the anti-pattern of MemberController by moving transactional code to MemberService

* refactor: Refactor minor code dirty

* refactor: Refactor legacy MemberControllerTest by removing unnessary tests and spliting to MemberServiceTest due to anti-pattern refactoring

* refactor: Resolve code smell issue, distinguishing AuthenticationFailedException by ErrorCode

* feat: Add MemberServiceTests for projections methods

* [OING-305] feature: Mission 도입에 맞춰 Post 테이블 변경 (#225)

* feature: add type and mission_id column sql

* feature: add type and mission_id column to Post Entity

* test: fix test due to added column

* feat: change type field's type in Post

* hotfix: add Enumerated annotation (#226)

* hotfix: Type 필드 추가하면서 발생하는 에러 해결 (#227)

* hotfix: add Enumerated annotation

* hotfix: change char to varchar

* [OING-302] feature: 미션 포스트 작성/조회 모킹 API 추가 (#228)

* feat: add type field in constructor

* feat: add mission post create/read mocking api

* test: fix failed test due to added type field

* style: add comment

* refactor: change type's validate logic in create post

* refactor: change type enum value

* refactor: rename Enum Type

* refactor: change if to swith

* feature: change validateUploadTime's bound (#229)

* [OING-307] feat: Mission 모듈 추가 (#230)

* fix: Fix broken flyway db.migration V202404152221__create_Mission_modules_tables.sql (#233)

* [OING-309] feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking (#232)

* [OING-308] feat: 가족구성원 랭킹 API 모킹 (#231)

* feat: Add HomeApi and getFamilyMemberMonthlyRanking spec

* feat: Add getFamilyMemberMonthlyRanking api response mocking at HomeController

* feature: add set type column value sql (#234)

* [OING-314] feature: 회원 생존신고 게시글 업로드 여부 / 회원 미션 참여 가능 여부 확인 mock API 추가 (#235)

* feature: add getMissionEligibleStatus and getSurvivalUploadStatus mock api

* refactor: rename api name and dto field

* [OING-311] feat: 뷰 기반 API 중 메인 페이지 API 구현 (#237)

* feat: add view based api

* docs: update view based api docs

* feat: add isMeUploaded

* fix: update birthday evaluate logics

* [OING-315] feature: 미션 게시글 업로드/조회 API 구현 (검증 로직 제외) (#236)

* refactor: change exception name

* feature: add createMissionPost logic

* feature: add searchMissionPost

* refactor: add available parameter in createPost and fetchDailyFeeds

* refactor: seperate validate logic in mission post

* [OING-317] refactor: 뷰 기반 API를 둘러싼 교통정리 1 (#238)

* feat: Add leftUploadCountUntilMissionUnlock, dailyMissionConten and Add debug parameter to control boolean flag

* refactor: Integrate HomeAPI to MainViewController and Add getNighttimePage API

* fix: Fix wrongly written get mapping url of getNighttimePage

* fix: Add the missing GetMapping annotation and fix wrongly written swagger summary

* [OING-316] feature: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 구현 (#239)

* feature: add getRemainingSurvivalPostCount Api

* feature: add getRemainingSurvivalPostCount logic to getDaytimePage Api

* test: add getRemainingSurvivalPostCount Repository test

* test: add getRemainingSurvivalPostCount Api test

* [OING-304] feature: 회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 API 구현 (#240)

* feature: add getSurvivalUploadStatus API logic

* feature: add getMissionAvailableStatus API

* test: add getMissionAvailable Repository Test

* test: add getMissionAvailable and getSurvivalUploadStatus Api Test

* style: change response dto field name

* feature: add getMissionAvailableStatus and getSurvivalUploadStatus logic to getDaytimePage

* refactor: correct anti code

* refactor: add member.deletedAt.isNull condition to isCreatedSurvivalPostByMajority

* [OING-320] refactor: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 로직 리팩터링 (#242)

* refactor: refact calculateRemainingSurvivalPostCountUntilMissuonUnlocked logic

* feature: add isActiveMember method and refact code

* test: refact test code due to seperated logic

* test: add calculateRemainingSurvivalPostCountUntilMissionUnlocked test code

* [OING-319] feat: 메인 페이지에서 필요한 추가 요청받은 API 구현/모킹 (#241)

* feat: Add mostRecentSurvivalPostDate in FamilyMemberMonthlyRankingResponse according to requirement

* feat: Add isMeMissionUploadedToday field And Rename IsMeUploadedToday as isMeSurvivalUploadedToday from DaytimePageResponse

* fix: Fix broken PostApiTest and Add new test for added api

* refactor: add today date log to validateUserHasNotCreatedPost logic (#243)

* [OING-324] refactor: NighttimeMainPage의 displayRank 필드는 늘 NULL이 되도록 수정 (#245)

* [OING-323] feat: 일간 캘린더 API 추가 (#244)

* feat: Divide getCalendar API to getMonthlyCalendar and getDailyCalendar And Impl getDailyCalendar

* fix: Add CalendarAPI test code for getDailyCalendar and fix the bug found by test code

* refactor: Remove debug system print code

* refactor: Extract the code to map post to calendar response as the method

* refactor: Extract the code to calculate allFamilyMembersUploaded as the method

* fix: Fix the runtime exception during PostType enum mapping

* refactor: Refactoring getXXXCalendar mapping stragey from params to url parameter

* hotfix: Restore getMonthlyCalendar API as deprecated lagacy for compatibilityu

* [OING-328] feat: DailyCalendarResponse에 PostResponse 필드 추가 (프론트 요청) (#247)

* fix: Add the fields of PostResponse in DailyCalendarResponse

* fix: Fix broken CalendarApiTest

* fix: Fix broken CalendarApiTest2

* [OING-325] feat: 가족구성원 랭킹 API 기능 구현 (#246)

* feat: Add getFamilyMembersMonthlySurvivalRanking API in PostController

* feat: Add mvc test code for new API(getFamilyMembersMonthlySurvivalRanking) with nested test class

* feat: Impl getFamilyMemberMonthlyRanking API at MainViewController

* feat: Add mvc test code for new API(getFamilyMemberMonthlyRanking) at MainViewApiTest

* fix: Add stream filter to exclude familyMember who didnt upload post at that month from getFamilyMembersMonthlySurvivalRanking API of PostController and Add test code to validate it from PostApiTest and MainViewApiTest

* fix: Fix failed broken test code

* fix: Fix failed broken test code2

* refactor: Refactor compareTo method of PostRankerDTO for better readability

* refactor: Add blank line at that last of MainViewApiTest

* refactor: Extract duplicated mapping code from getFamilyMemberMonrhlyRanking method of MainViewController

* fix: Fix IndexOutOfBoundsException from getFamilyMemberMonthlyRanking API

* [OING-329] refactor: 미션 검증 로직 중에서 가족 구성원 수 계산할 때, 어제 날짜 기준으로 세도록 수정 (#248)

* refactor: count family members by family ID logic to count based on yesterday's date

* test: fix broken test due to changed logic

* style: change api summary

* refactor: delete unused method

* refactor: refactor isCreatedSurvivalPostByMajority code

* test: delete unused test

* [OING-326] feat: 일일 미션 배치 구현 및 테스트코드 추가 (#249)

* chore: Add mission module path in the targets of cicd modification checking

* feat: Add DailyMissionRegistrationJob in DailyMissionJob with Spring scheduler and table lock

* feat: Impl the methods of MissionService and DailyMissionHistyoryService those api responses was mocked

* feat: Add exceptions handling at DailyMissionRegistrationJob

* feat: Add DailyMissionHistoryRepositoryTest

* feat: Add MissionRepositoryTest for getRandomMissionExcludingIds

* feat: Add DailyMissionJobTest for registerDailyMission

* feat: Add error handling code for duplicated attempting to create daily mission history and catch exception code

* feat: Add tests for newly added error handling and exception catching code

* refactor: Refactor method and parameter name according to naming convention

* refactor: Delete unnecessary Repository annocation from DailyMissionHistoryRepositoryCustomImpl

* fix: Make Nested test class lower case

* fix: Add missing PathVariable at input paramter of getMissionByMissionId (#252)

* [OING-330] feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 (#250)

* feat: Add getLatestPost API to implement new policy of family member ranking

* fix: Add null handling in getLatestPostAPI

* feat: Make mostRecentSurvivalPostDate return most recent surcicial post date in this month else then return null

* refactor: Refactor nested test class in MianviewApiTest to follow naming convention

* feat: Add test code for findLatestPost in PostRepositoryCustomImpl

* refactor: Add PostType paramter at getRecentPost API

* feat: Add createdAt index at post table

* [OING-318] feature: 미션 게시글 등록 기능에 미션 등록 권한 검증 로직 추가 (#251)

* feature: add validateMissionPostCreateAccessMember logic

* feature: handle Mission Post Access Denied Exceptions

* test: add createMissionPost test

* style: change leftUploadCountUntilMissionUnlock field description

* test: change parameter value in createPost Api test

* test: delete createMissionPost test for normal case

* feature: change exception code

* feat: Restore mistakenly deleted method

* feat: Enable validation code for duplicated family disabled due to iOS buf from on-boarding

---------

Co-authored-by: Kwon770 <[email protected]>

---------

Co-authored-by: 송영민 (YeongMin Song) <[email protected]>
Co-authored-by: sckwon770 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ FEATURE 기능 추가 ✅ TEST 테스트 코드 추가 우선순위_3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants