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-323] feat: 일간 캘린더 API 추가 #244

Merged
merged 6 commits into from
Apr 28, 2024
Merged

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

merged 6 commits into from
Apr 28, 2024

Conversation

Kwon770
Copy link
Collaborator

@Kwon770 Kwon770 commented Apr 26, 2024

❓ 기능 추가 배경


�미션 게시글이 추가됨에 따라, 주간(일별로 보는) 캘린더에서 생존신고 게시글 다음에 미션 게시글이 나타나는 정책이 추가되었고 미션 게시글 또한 캘린더 DTO에서 대응해야했습니다. 기존에는 프론트가 fetchPosts 공용 API를 이용해 게시글을 조회하고 이를 잘 가공하여 보여주는 방식이었는데, 공용 API의 기능이 이미 비대하고 새로운 기능들이 프론트에서 구현하기 복잡하여 프론트에 맞춘 뷰 기반 API를 추가했습니다.

➕ 추가/변경된 기능


  • getCalendar API를 getMonthlyCalendar와 getDailyCalendar로 분리하고, getDailyCalendar를 구현 (API추가, DTO 추가, 필요한 비즈니스 코드 추가 및 연결)
  • 테스트 코드 추가

🥺 리뷰어에게 하고싶은 말


프론트에서 계속 요청들어오는 부분이라 �빠르게 부탁드려요!

🔗 참조 or 관련된 이슈


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

@Kwon770 Kwon770 requested review from CChuYong and Ji-soo708 April 26, 2024 17:53
@Kwon770 Kwon770 self-assigned this Apr 26, 2024
@github-actions github-actions bot changed the title feat: 일간 캘린더 API 추가 [OING-323] feat: 일간 캘린더 API 추가 Apr 26, 2024
Copy link

github-actions bot commented Apr 26, 2024

Test Results

 40 files   40 suites   10s ⏱️
119 tests 119 ✅ 0 💤 0 ❌
120 runs  120 ✅ 0 💤 0 ❌

Results for commit c6c64e0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 26, 2024

Code Coverage

File Coverage [81.38%] 🍏
MonthlyCalendarResponse.java 100% 🍏
DailyCalendarResponse.java 100% 🍏
CalendarController.java 83.37% 🍏
MemberBridgeImpl.java 80.28% 🍏
MissionService.java 69.23%
MissionBridgeImpl.java 45.45%
Total Project Coverage 48.96% 🍏

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.

API 정상 동작하는 거까지 확인했습니다. 수고하셨습니다! 코멘트 확인해주세요~

Copy link

sonarcloud bot commented Apr 28, 2024

Quality Gate Passed Quality Gate passed

Issues
3 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
Copy link
Collaborator Author

Kwon770 commented Apr 28, 2024

@Ji-soo708 님이 주신 피드백 반영해 수정하였습니다! 머지할게요

@Kwon770 Kwon770 merged commit 4c7c39a into dev Apr 28, 2024
4 checks passed
@Kwon770 Kwon770 deleted the feature/OING-323 branch April 28, 2024 09:02
Ji-soo708 pushed a commit that referenced this pull request May 9, 2024
* 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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants